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

Dependency upgrades & minor CI renovation #318

Merged
merged 4 commits into from
Nov 4, 2024
Merged
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
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: foo@example.com
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/action@v3.0.1
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?
Going with uniform quote style everywhere would be preferable IMO.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for backward compatibility (so every little change doesn’t require reformatting)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah – without it, this minor PR would've reformatted a bunch of files.


[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