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

build(deps): update dependencies #678

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
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
17 changes: 11 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
submodules: true
- name: Install packages
run: |
sudo snap install --no-wait ruff
sudo snap install --no-wait shellcheck
sudo snap install --no-wait woke
sudo snap install --no-wait --classic node
sudo snap install --no-wait --classic pyright
sudo apt update
sudo apt install -y libapt-pkg-dev aspell aspell-en
- name: Set up Python 3.10
Expand Down Expand Up @@ -44,22 +49,22 @@ jobs:
make test-pydocstyle
- name: Run pyright
run: |
sudo snap install --classic node
sudo snap install --classic pyright
sudo snap watch --last=install
make test-pyright
- name: Run pylint
- name: Run ruff
run: |
make test-pylint
sudo snap watch --last=install
make test-ruff
- name: Run sphinx-lint
run: |
make test-sphinx-lint
- name: Run shellcheck
run: |
sudo snap install shellcheck
sudo snap watch --last=install
make test-shellcheck
- name: Run linkcheck,woke,spelling
run: |
sudo snap install woke
sudo snap watch --last=install
make test-docs

tests:
Expand Down
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
RUFF := $(shell ruff --version 2> /dev/null)

.PHONY: help
help: ## Show this help.
@printf "%-40s %s\n" "Target" "Description"
Expand All @@ -6,6 +8,9 @@ help: ## Show this help.

.PHONY: autoformat
autoformat: ## Run automatic code formatters.
ifndef RUFF
$(error "Ruff not installed. Install it with `sudo snap install ruff` or using the official installation instructions: https://docs.astral.sh/ruff/installation/")
endif
autoflake rockcraft/ tests/
black .
ruff check --fix-only rockcraft tests
Expand Down Expand Up @@ -69,7 +74,7 @@ install: clean ## Install python package.
python setup.py install

.PHONY: lint
lint: test-black test-codespell test-flake8 test-mypy test-pydocstyle test-pyright test-pylint test-sphinx-lint test-shellcheck ## Run all linting tests.
lint: test-black test-codespell test-flake8 test-mypy test-pydocstyle test-pyright test-ruff test-sphinx-lint test-shellcheck ## Run all linting tests.

.PHONY: release
release: dist ## Release with twine.
Expand All @@ -89,7 +94,10 @@ test-flake8:

.PHONY: test-ruff
test-ruff:
ruff rockcraft tests
ifndef RUFF
$(error "Ruff not installed. Install it with `sudo snap install ruff` or using the official installation instructions: https://docs.astral.sh/ruff/installation/")
endif
ruff check rockcraft tests

.PHONY: test-integrations
test-integrations: ## Run integration tests.
Expand All @@ -105,8 +113,8 @@ test-pydocstyle:

.PHONY: test-pylint
test-pylint:
pylint rockcraft
pylint tests --disable=invalid-name,missing-module-docstring,missing-function-docstring,redefined-outer-name,too-many-arguments,too-many-public-methods,no-member,import-outside-toplevel
echo "rockcraft has replaced pylint with ruff. Please use `make test-ruff` instead."
make test-ruff

.PHONY: test-pyright
test-pyright:
Expand Down
2 changes: 2 additions & 0 deletions extensions/django-framework/gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""gunicorn configuration."""

bind = ["0.0.0.0:8000"]
chdir = "/django/app"
statsd_host = "localhost:9125"
2 changes: 2 additions & 0 deletions extensions/flask-framework/gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""gunicorn configuration."""

bind = ["0.0.0.0:8000"]
chdir = "/flask/app"
statsd_host = "localhost:9125"
34 changes: 28 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extend-exclude = [
"rockcraft/_version.py"
]
# Follow ST063 - Maintaining and updating linting specifications for updating these.
select = [ # Base linting rule selections.
lint.select = [ # Base linting rule selections.
# See the internal document for discussion:
# https://docs.google.com/document/d/1i1n8pDmFmWi4wTDpk-JfnWCVUThPJiggyPi2DYwBBu4/edit
# All sections here are stable in ruff and shouldn't randomly introduce
Expand All @@ -124,7 +124,7 @@ select = [ # Base linting rule selections.
"RET", # Simpler logic after return, raise, continue or break
"UP018", "C408", # Convert type calls to literals. The latest pylint enforces this, but ruff has auto-fixes.
]
extend-select = [
lint.extend-select = [
# These sets are still frequently getting new rules.
# Therefore, they're getting frozen with the current rules so we can
# upgrade ruff without breaking linting.
Expand All @@ -150,7 +150,7 @@ extend-select = [
"RUF005", # Encourages unpacking rather than concatenation
"RUF100", # #noqa directive that doesn't flag anything.
]
ignore = [
lint.ignore = [
#"E203", # Whitespace before ":" -- Commented because ruff doesn't currently check E203
"E501", # Line too long (reason: black will automatically fix this for us)
"D105", # Missing docstring in magic method (reason: magic methods already have definitions)
Expand All @@ -162,14 +162,36 @@ ignore = [

]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.lint.pydocstyle]
ignore-decorators = [ # Functions with these decorators don't have to have docstrings.
"typing.overload", # Default configuration
# The next four are all variations on override, so child classes don't have to repeat parent classes' docstrings.
"overrides.override",
"overrides.overrides",
"typing.override",
"typing_extensions.override",
]

[tool.ruff.lint.pylint]
max-args = 8

[tool.ruff.lint.pep8-naming]
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
classmethod-decorators = ["pydantic.validator", "pydantic.root_validator"]

[tool.ruff.lint. per-file-ignores]
"tests/**.py" = [ # Some things we want for the moin project are unnecessary in tests.
"D", # Ignore docstring rules in tests
"ANN", # Ignore type annotations in tests
"S101", # Allow assertions in tests
"S103", # Allow `os.chmod` setting a permissive mask `0o555` on file or directory
"S108", # Allow Probable insecure usage of temporary file or directory
"S103", # Allow `os.chmod` setting a permissive mask `0o555` on file or directory
"S105", # Allow (fake) secrets in tests.
"S108", # Allow Probable insecure usage of temporary file or directory
"PLR0913", # Allow many arguments for test functions
"PLR2004", # Allow magic values in tests
]
# isort leaves init files alone by default, this makes ruff ignore them too.
"__init__.py" = ["I001"]
Expand Down
40 changes: 16 additions & 24 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ annotated-types==0.7.0
anyio==4.4.0
apeye==1.4.1
apeye-core==1.1.5
astroid==3.2.4
autodocsumm==0.2.13
autoflake==1.7.8
babel==2.16.0
Expand All @@ -13,7 +12,7 @@ black==24.8.0
boolean.py==4.0
bracex==2.5
CacheControl==0.14.0
cachetools==5.4.0
cachetools==5.5.0
canonical-sphinx==0.1.0
canonical-sphinx-extensions==0.0.23
certifi==2024.7.4
Expand All @@ -24,7 +23,7 @@ click==8.1.7
codespell==2.3.0
colorama==0.4.6
coverage==7.6.1
craft-application==4.0.0
craft-application==4.1.0
craft-archives==2.0.0
craft-cli==2.6.0
craft-grammar==2.0.0
Expand All @@ -33,7 +32,6 @@ craft-providers==2.0.0
cryptography==43.0.0
cssutils==2.11.1
dict2css==0.3.0.post1
dill==0.3.8
distlib==0.3.8
distro==1.9.0
docutils==0.21.2
Expand All @@ -47,24 +45,23 @@ GitPython==3.1.43
h11==0.14.0
html5lib==1.1
httplib2==0.22.0
idna==3.7
idna==3.8
imagesize==1.4.1
importlib_metadata==8.2.0
importlib_metadata==8.4.0
iniconfig==2.0.0
isort==5.13.2
jaraco.classes==3.4.0
jaraco.context==5.3.0
jaraco.context==6.0.1
jaraco.functools==4.0.2
jeepney==0.8.0
Jinja2==3.1.4
keyring==25.3.0
launchpadlib==2.0.0
lazr.restfulclient==0.14.6
lazr.uri==1.0.6
license-expression==30.3.0
license-expression==30.3.1
linkify-it-py==2.0.3
lxml==5.2.2
Markdown==3.6
lxml==5.3.0
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mccabe==0.6.1
Expand Down Expand Up @@ -94,13 +91,10 @@ pydocstyle==6.3.0
pyflakes==2.4.0
pygit2==1.14.1
Pygments==2.18.0
pylint==3.2.6
pylint-fixme-info==1.0.4
pylint-pytest==1.1.8
pyparsing==3.1.2
pyproject-api==1.7.1
pyspelling==2.10
pytest==8.2.0
pytest==8.3.2
pytest-check==2.3.1
pytest-mock==3.14.0
pytest-subprocess==1.5.2
Expand All @@ -115,14 +109,13 @@ rfc3986==2.0.0
rich==13.7.1
ruamel.yaml==0.18.6
ruamel.yaml.clib==0.2.8
ruff==0.3.5
SecretStorage==3.3.3
six==1.16.0
smmap==5.0.1
snap-helpers==0.4.2
sniffio==1.3.1
snowballstemmer==2.2.0
soupsieve==2.5
soupsieve==2.6
spdx==2.5.1
spdx-lookup==0.3.3
Sphinx==7.4.7
Expand All @@ -135,7 +128,7 @@ sphinx-lint==0.9.1
sphinx-notfound-page==1.0.4
sphinx-prompt==1.8.0
sphinx-tabs==3.4.5
sphinx-toolbox==3.7.0
sphinx-toolbox==3.8.0
sphinx_design==0.6.1
sphinx_reredirects==0.1.5
sphinxcontrib-applehelp==2.0.0
Expand All @@ -150,22 +143,21 @@ sphinxext-opengraph==0.9.1
starlette==0.38.2
tabulate==0.9.0
tomli==2.0.1
tomlkit==0.13.0
tox==4.17.1
tox==4.18.0
twine==5.1.1
types-PyYAML==6.0.12.20240808
types-requests==2.31.0.6
types-setuptools==71.1.0.20240806
types-setuptools==73.0.0.20240822
types-tabulate==0.9.0.20240106
types-urllib3==1.26.25.14
typing_extensions==4.12.2
uc-micro-py==1.0.3
urllib3==1.26.19
uvicorn==0.30.5
uvicorn==0.30.6
virtualenv==20.26.3
wadllib==1.3.6
watchfiles==0.23.0
wcmatch==9.0
webencodings==0.5.1
websockets==12.0
zipp==3.19.2
websockets==13.0
zipp==3.20.0
22 changes: 11 additions & 11 deletions requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cffi==1.17.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
craft-application==4.0.0
craft-application==4.1.0
craft-archives==2.0.0
craft-cli==2.6.0
craft-grammar==2.0.0
Expand All @@ -35,17 +35,17 @@ GitPython==3.1.43
h11==0.14.0
html5lib==1.1
httplib2==0.22.0
idna==3.7
idna==3.8
imagesize==1.4.1
importlib_metadata==8.2.0
importlib_metadata==8.4.0
Jinja2==3.1.4
launchpadlib==2.0.0
lazr.restfulclient==0.14.6
lazr.uri==1.0.6
license-expression==30.3.0
license-expression==30.3.1
linkify-it-py==2.0.3
lxml==5.2.2
Markdown==3.6
lxml==5.3.0
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mdit-py-plugins==0.4.1
Expand Down Expand Up @@ -79,7 +79,7 @@ smmap==5.0.1
snap-helpers==0.4.2
sniffio==1.3.1
snowballstemmer==2.2.0
soupsieve==2.5
soupsieve==2.6
spdx==2.5.1
spdx-lookup==0.3.3
Sphinx==7.4.7
Expand All @@ -92,7 +92,7 @@ sphinx-lint==0.9.1
sphinx-notfound-page==1.0.4
sphinx-prompt==1.8.0
sphinx-tabs==3.4.5
sphinx-toolbox==3.7.0
sphinx-toolbox==3.8.0
sphinx_design==0.6.1
sphinx_reredirects==0.1.5
sphinxcontrib-applehelp==2.0.0
Expand All @@ -110,10 +110,10 @@ tomli==2.0.1
typing_extensions==4.12.2
uc-micro-py==1.0.3
urllib3==1.26.19
uvicorn==0.30.5
uvicorn==0.30.6
wadllib==1.3.6
watchfiles==0.23.0
wcmatch==9.0
webencodings==0.5.1
websockets==12.0
zipp==3.19.2
websockets==13.0
zipp==3.20.0
2 changes: 1 addition & 1 deletion requirements-jammy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu2/python-apt_2.4.0ubuntu2.tar.xz; sys_platform == 'linux'
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu2/python-apt_2.4.0ubuntu2.tar.xz ; sys_platform == 'linux'
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ boolean.py==4.0
certifi==2024.7.4
cffi==1.17.0
charset-normalizer==3.3.2
craft-application==4.0.0
craft-application==4.1.0
craft-archives==2.0.0
craft-cli==2.6.0
craft-grammar==2.0.0
craft-parts==2.0.0
craft-providers==2.0.0
distro==1.9.0
httplib2==0.22.0
idna==3.7
importlib_metadata==8.2.0
idna==3.8
importlib_metadata==8.4.0
launchpadlib==2.0.0
lazr.restfulclient==0.14.6
lazr.uri==1.0.6
license-expression==30.3.0
license-expression==30.3.1
oauthlib==3.2.2
overrides==7.7.0
packaging==24.1
Expand All @@ -41,4 +41,4 @@ tabulate==0.9.0
typing_extensions==4.12.2
urllib3==1.26.19
wadllib==1.3.6
zipp==3.19.2
zipp==3.20.0
Loading
Loading