Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize package #80

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ current_version = 0.2.0
commit = True
tag = True

[bumpversion:file:./setup.py]
[bumpversion:file:pyproject.toml]
[bumpversion:file:./docs/conf.py]
[bumpversion:file:./README.md]
[bumpversion:file:spins/__init__.py]
23 changes: 0 additions & 23 deletions .flake8

This file was deleted.

17 changes: 6 additions & 11 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@ name: Sphinx docs to gh-pages
on:
push:
branches:
- master
- main
workflow_dispatch:

jobs:
sphinx_docs_to_gh-pages:
runs-on: ubuntu-latest
name: Sphinx docs to gh-pages
steps:
- name: Cancel Workflow Action
uses: styfle/[email protected]
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
python-version: 3.10
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
Expand All @@ -27,14 +25,11 @@ jobs:
- name: Installing the library
shell: bash -l {0}
run: |
pip install -r requirements_dev.txt
pip install -e .
sudo wget https://github.com/jgm/pandoc/releases/download/1.16.0.2/pandoc-1.16.0.2-1-amd64.deb
sudo dpkg -i pandoc-1.16.0.2-1-amd64.deb
#sudo apt install pandoc
pip install -e .[docs]
sudo apt install pandoc
- name: Running the Sphinx to gh-pages Action
uses: uibcdf/[email protected]
with:
branch: master
branch: main
dir_docs: docs
sphinxopts: ""
16 changes: 0 additions & 16 deletions .github/workflows/pre-commit.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/pythonpublish.yml

This file was deleted.

88 changes: 73 additions & 15 deletions .github/workflows/test_code.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,92 @@
---
name: Lint and Test
# https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python
name: Test pre-commit, code and docs

on:
pull_request:
push:
schedule:
- cron: 0 2 * * * # run at 2 AM UTC
branches:
- main

jobs:
build:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
test_code:
needs: [pre-commit]
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, windows-latest]
python-version: [3.7, "3.10"]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Cancel Workflow Action
uses: styfle/[email protected]
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install .
pip install -e .
pip install flake8 pytest pytest_regressions
- name: Lint with flake8
run: |
flake8 .
- name: Test with pytest
run: pytest
test_docs:
needs: [pre-commit]
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: [3.9]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: anaconda-client-env
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt install pandoc
make install
- name: Test documentation
run: |
cd docs
make html
release_pypi:
needs: [pre-commit]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
28 changes: 0 additions & 28 deletions .github/workflows/test_docs.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .gitlab-ci.yml

This file was deleted.

Loading