Skip to content

Commit

Permalink
Dependency upgrades & minor CI renovation (#318)
Browse files Browse the repository at this point in the history
* Adjust lower bounds for deps supplied by us

* Upgrade lint tools

* Move test deps to pyproject.toml; use uv in CI

* Fix Codecov reporting
  • Loading branch information
akx authored Nov 4, 2024
1 parent ec86fae commit a1d01f0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,26 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
cache: "pip"
cache-dependency-path: "**/requirements*txt"
- run: pip install -U pip setuptools wheel
- run: "pip install -e . -r requirements-test.txt"
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- run: uv pip install --system -e .[test]
- run: make test
env:
EMAIL: [email protected]
GIT_AUTHOR_NAME: Foo Bar
GIT_COMMITTER_NAME: Foo Bar
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- uses: pre-commit/[email protected]
Build:
runs-on: ubuntu-20.04
Expand All @@ -53,10 +54,8 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "**/requirements*txt"
- run: pip install build
- run: python -m build
- uses: astral-sh/setup-uv@v3
- run: uv build --wheel
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.7.2
hooks:
- id: ruff
args:
- --fix
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
- types-PyYAML
- types-requests

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: debug-statements
- id: end-of-file-fixer
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ dev:
ifndef UV
pip install -U pip
endif
$(PIP_INSTALL) -r requirements-test.txt
$(PIP_INSTALL) pre-commit
$(PIP_INSTALL) -e .
$(PIP_INSTALL) pre-commit -e .[test]
pre-commit install

.PHONY: lint
Expand Down
16 changes: 13 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ authors = [
]
dependencies = [
"click>=8.0",
"gitignorant>=0.2.0",
"gitignorant>=0.4.0",
"requests-toolbelt>=0.7.1",
"requests>=2.0.0",
"valohai-utils>=0.3.0",
"valohai-yaml>=0.40.0",
"valohai-utils>=0.5.0",
"valohai-yaml>=0.43.0",
]

[project.optional-dependencies]
test = [
"pytest-cov~=4.0",
"pytest~=7.0",
"requests-mock~=1.10",
]

[project.scripts]
Expand Down Expand Up @@ -59,6 +66,9 @@ target-version = "py38"
line-length = 110
preview = true

[tool.ruff.format]
quote-style = "preserve"

[tool.ruff.lint]
ignore = [
"E501",
Expand Down
5 changes: 0 additions & 5 deletions requirements-test.txt

This file was deleted.

2 changes: 1 addition & 1 deletion valohai_cli/commands/yaml/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def pipeline(filenames: List[str], yaml: Optional[str]) -> None:
old_config = project.get_config(yaml_path=yaml)
except FileNotFoundError as fnfe:
raise ConfigurationError(
f"Did not find {yaml_filename}. " f"Can't create a pipeline without preconfigured steps.",
f"Did not find {yaml_filename}. Can't create a pipeline without preconfigured steps.",
) from fnfe
try:
new_config = get_pipeline_from_source(source_path, old_config)
Expand Down

0 comments on commit a1d01f0

Please sign in to comment.