Skip to content

Commit

Permalink
Pin versions and add requirements lock file for testing and monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Feb 5, 2024
1 parent d9a2f5b commit 0e862ca
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 25 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ jobs:
run: |
python -m pip install -U pip
pip install -U setuptools wheel
pip install -e .[all]
pip install -r requirements/requirements.txt
pip install -e .[docs]
- name: Set git config
run: |
Expand Down Expand Up @@ -62,7 +63,6 @@ jobs:
run: |
# Required to generate rst files from markdown
sudo apt install pandoc
pip install .[docs]
- name: Build Sphinx docs
working-directory: doc
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
release_branch: ${{ env.PUBLISH_UPDATE_BRANCH }}
since_tag: "${{ env.PREVIOUS_VERSION }}"
output: "release_changelog.md"
exclude_labels: "duplicate,question,invalid,wontfix,dependency_updates,skip_changelog"
exclude_labels: "duplicate,question,invalid,wontfix,dependency_updates,CI,skip_changelog"

- name: Append changelog to release body
run: |
Expand All @@ -114,6 +114,12 @@ jobs:
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository-url: https://test.pypi.org/legacy/

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}

deploy_docs:
if: github.repository == 'matgenix/jobflow-remote' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[strict,tests,dev]
pip install -r requirements/requirements.txt
pip install .[dev]
- name: Lint
run: pre-commit run --all-files --show-diff-on-failure
Expand All @@ -52,7 +53,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[strict,tests,docs]
pip install -r requirements/requirements.txt
pip install .[tests]
- name: Unit tests
run: pytest --cov=jobflow_remote --cov-report=xml --ignore tests/integration
Expand Down Expand Up @@ -87,6 +89,7 @@ jobs:
pip install -U setuptools wheel
# Required to generate rst files from markdown
sudo apt install pandoc
pip install -r requirements/requirements.txt
pip install .[docs]
- name: Build Sphinx docs
Expand Down
36 changes: 16 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 42", "versioningit ~= 1.0", "wheel"]
requires = ["setuptools >= 42", "versioningit ~= 1.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -25,31 +25,28 @@ classifiers = [
]
requires-python = ">=3.9"
dependencies =[
"jobflow",
"pydantic>=2.0.1",
"fabric",
"tomlkit",
"qtoolkit",
"typer",
"rich",
"psutil",
"supervisor",
"ruamel.yaml",
"schedule",
"flufl.lock"
"jobflow >= 0.1.14",
"pydantic ~= 2.5",
"fabric ~= 3.2",
"tomlkit ~= 0.12",
"qtoolkit ~= 0.1",
"typer ~= 0.9",
"rich ~= 13.7",
"psutil ~= 5.9",
"supervisor ~= 4.2",
"ruamel.yaml ~= 0.17",
"schedule ~= 1.2",
"flufl.lock ~= 8.0"
]

[project.optional-dependencies]
dev = [
"pre-commit>=3.0.0",
]
tests = [
"pytest==7.2.1",
"pytest-cov==4.0.0",
"docker~=7.0",
]
maintain = [
"git-changelog>=0.6",
"pytest ~= 7.2",
"pytest-cov ~= 4.0",
"docker ~= 7.0",
]
docs = [
"sphinx",
Expand All @@ -59,7 +56,6 @@ docs = [
"autodoc_pydantic>=2.0.0",
"sphinxcontrib-mermaid"
]
strict = []

[project.scripts]
jf = "jobflow_remote.cli.jf:app"
Expand Down
9 changes: 9 additions & 0 deletions requirements/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Strict requirements

These files contain pinned direct dependencies for use in testing, monitored by
dependabot to ensure version upgrades compatible with `pyproject.toml` do not
break the released version.

In cases where dependabot updates a requirements file and the tests no longer
pass, this may indicate that the supported versions in `pyproject.toml` need to
be upgraded (and a release made).
12 changes: 12 additions & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
jobflow==0.1.17
pydantic==2.5.3
fabric==3.2.2
tomlkit==0.12.3
qtoolkit==0.1.0
typer==0.9.0
rich==13.7.0
psutil==5.9.8
supervisor==4.2.5
ruamel.yaml==0.17.35
schedule==1.2.1
flufl.lock==8.0.2

0 comments on commit 0e862ca

Please sign in to comment.