diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ec1373c4..7e223e3a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,26 +14,25 @@ env: jobs: build: - runs-on: ubuntu-20.04 strategy: matrix: - py_version: ["3.8", "3.9", "3.10", "3.11"] + py_version: ["3.9", "3.10", "3.11", "3.12"] include: - - py_version: "3.8" - WITH_CODECOV: true - py_version: "3.9" WITH_CODECOV: true - py_version: "3.10" WITH_CODECOV: true - py_version: "3.11" WITH_CODECOV: true + - py_version: "3.12" + WITH_CODECOV: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.py_version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.py_version }} cache: pip @@ -54,6 +53,7 @@ jobs: run: | coverage run $(which pytest) -vv --hypothesis-show-statistics coverage report --omit='*/bin/pytest' + coverage xml - if: ${{ matrix.WITH_CODECOV }} name: Upload coverage codecov @@ -68,11 +68,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python 3 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.x' cache: pip cache-dependency-path: | **/setup.cfg @@ -93,11 +93,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python 3 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.x' cache: pip cache-dependency-path: | **/setup.cfg @@ -118,11 +118,18 @@ jobs: deploy: needs: [build, lint, docs] runs-on: ubuntu-latest - + environment: + name: pypi + url: https://pypi.org/p/vermouth + permissions: + id-token: write steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + with: + fetch-tags: true + fetch-depth: 0 + - name: Set up Python 3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: pip @@ -130,25 +137,14 @@ jobs: **/setup.cfg **/requirements-*.txt **/pyproject.toml - + - name: Install dependencies + run: | + pip install --upgrade setuptools pip + pip install --upgrade . - name: Install pypa/build - run: >- - python -m - pip install - build - --user - pip install pbr - + run: | + python3 -m pip install build pbr --user - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - - - name: Publish package to PyPI + run: python3 -m build --sdist --wheel --outdir dist/ + - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index f5dc5426..fa2e10b2 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -16,26 +16,25 @@ env: jobs: build: - runs-on: ubuntu-20.04 strategy: matrix: - py_version: ["3.8", "3.9", "3.10", "3.11"] + py_version: ["3.9", "3.10", "3.11", "3.12"] include: - - py_version: "3.8" - WITH_CODECOV: true - py_version: "3.9" WITH_CODECOV: true - py_version: "3.10" WITH_CODECOV: true - py_version: "3.11" WITH_CODECOV: true + - py_version: "3.12" + WITH_CODECOV: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.py_version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.py_version }} cache: pip @@ -71,11 +70,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python 3 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.x' cache: pip cache-dependency-path: | **/setup.cfg @@ -96,11 +95,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python 3 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.x' cache: pip cache-dependency-path: | **/setup.cfg @@ -116,3 +115,39 @@ jobs: run: | mkdir -p doc/source/_static sphinx-build -EnW -b html doc/source/ doc/build/html + + deploy: + needs: [build, lint, docs] + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/vermouth + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + with: + fetch-tags: true + fetch-depth: 0 + - name: Set up Python 3 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: pip + cache-dependency-path: | + **/setup.cfg + **/requirements-*.txt + **/pyproject.toml + - name: Install dependencies + run: | + pip install --upgrade setuptools pip + pip install --upgrade . + - name: Install pypa/build + run: | + python3 -m pip install build pbr --user + - name: Build a binary wheel and a source tarball + run: python3 -m build --sdist --wheel --outdir dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index b2a592a4..980ae368 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ requires = [ "setuptools >= 30.3.0", "pbr", ] +build-backend = "pbr.build" [tool.pytest.ini_options] addopts = "--import-mode=importlib" diff --git a/setup.cfg b/setup.cfg index fb0f3fc2..c51c299e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,10 +17,10 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: OS Independent Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Topic :: Scientific/Engineering :: Bio-Informatics Topic :: Scientific/Engineering :: Chemistry keywords = martini MD martinize