-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile development dependencies with uv compile
- Loading branch information
Showing
17 changed files
with
170 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Dependency Locks Check | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- dev-requirements/* | ||
|
||
jobs: | ||
check-locks: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Check dependency locks | ||
run: | | ||
pip install -r dev-requirements.txt | ||
nox -s check-dependency-locks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pip-audit==2.7.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
setuptools>=65.2.0 | ||
wheel==0.43.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
codespell==2.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage[toml]==7.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
flake8==7.1.0 | ||
|
||
# Plugins | ||
# Ref: https://github.com/DmytroLitvinov/awesome-flake8-extensions | ||
|
||
flake8-bandit~=4.1.1 # runs bandit | ||
flake8-black==0.3.6 # runs black | ||
flake8-builtins==2.5.0 # builtin shadowing checks | ||
flake8-coding==1.3.2 # coding magic-comment detection | ||
flake8-comprehensions==3.15.0 # comprehension checks | ||
flake8-docstrings==1.7.0 # pydocstyle support | ||
flake8-executable==2.1.3 # shebangs | ||
flake8-fixme==1.1.1 # "fix me" counter | ||
flake8-functions==0.0.8 # function linting | ||
flake8-html==0.4.3 # html output | ||
flake8-isort==6.1.1 # runs isort | ||
flake8-mutable==1.2.0 # mutable default argument detection | ||
flake8-pep3101==2.1.0 # new-style format strings only | ||
flake8-print==5.0.0 # complain about print statements in code | ||
flake8-printf-formatting==1.1.2 # forbey printf-style python2 string formatting | ||
flake8-pytest-style==2.0.0 # pytest checks | ||
flake8-raise==0.0.5 # exception raising linting | ||
flake8-use-fstring==1.4 # format string checking | ||
flake8-noqa==1.4.0 # validate noqa commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
black==24.4.2 | ||
isort==5.13.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
mkdocs==1.6.0 | ||
|
||
# Mkdocs Material | ||
mkdocs-material[imaging]==9.5.31 | ||
|
||
# Docstring parsing for API reference | ||
mkdocstrings[python]==0.25.2 | ||
griffe-inherited-docstrings==1.0.0 | ||
|
||
# Generate API reference pages dynamically | ||
mkdocs-gen-files==0.5.0 | ||
mkdocs-literate-nav==0.6.1 | ||
|
||
# Minify | ||
mkdocs-minify-plugin==0.8.0 | ||
|
||
# Formatting signatures | ||
black==24.4.2 | ||
|
||
# Image viewer ext | ||
# mkdocs-glightbox==0.3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mypy==1.10.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pyright==1.1.374 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# mock in the stdlib changes between versions of Python, so are not consistent in behaviour like the backport is | ||
mock==5.1.0 | ||
|
||
pytest==8.3.2 | ||
pytest-asyncio==0.23.8 | ||
pytest-cov==5.0.0 | ||
pytest-randomly==3.15.0 | ||
|
||
async-timeout==4.0.3 # Used for timeouts in some test cases. | ||
|
||
-r coverage.in # Consistent coverage version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
twine==5.1.1 | ||
|
||
-r build.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
slotscheck==0.19.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
towncrier==24.7.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2020 Nekokatt | ||
# Copyright (c) 2021-present davfsa | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
"""Lock file pipelines.""" | ||
import pathlib | ||
|
||
from pipelines import config | ||
from pipelines import nox | ||
|
||
|
||
def _generate_lock(session: nox.Session, requirements_path: pathlib.Path) -> str: | ||
return session.run( | ||
"uv", | ||
"pip", | ||
"compile", | ||
requirements_path, | ||
"-q", | ||
"--universal", | ||
"--generate-hashes", | ||
"--python-version", | ||
"3.8.1", # This will be the minimum version allowed for development dependencies | ||
silent=True, | ||
) | ||
|
||
|
||
@nox.session(venv_backend="none") | ||
def lock_dependencies(session: nox.Session) -> None: | ||
"""Generate development dependencies locks.""" | ||
|
||
for req_in in pathlib.Path(config.DEV_REQUIREMENTS_DIRECTORY).glob("*.in"): | ||
lock = _generate_lock(session, req_in) | ||
|
||
output_path = req_in.with_suffix(".txt") | ||
output_path.write_text(lock) | ||
|
||
|
||
@nox.session(venv_backend="none") | ||
def check_dependency_locks(session: nox.Session) -> None: | ||
"""Check dependencies locks.""" | ||
failure = False | ||
|
||
for req_in in pathlib.Path(config.DEV_REQUIREMENTS_DIRECTORY).glob("*.in"): | ||
expected = _generate_lock(session, req_in) | ||
|
||
output_path = req_in.with_suffix(".txt") | ||
current = output_path.read_text() | ||
|
||
if expected != current: | ||
failure = True | ||
session.warn(f"{output_path} is not up to date!") | ||
|
||
if failure: | ||
session.error("Found outdated locks, try running `nox -s lock-dependencies` to fix them") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters