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

chore: use pip-compile for freezing dependencies #11

Merged
merged 1 commit into from
Aug 2, 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
5 changes: 5 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ops
jsonschema
cryptography
requests
rpds-py==0.18.0
50 changes: 45 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
ops ~= 2.15
jsonschema
cryptography >= 42.0.0
requests
rpds-py==0.18.0
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
#
attrs==23.2.0
# via
# jsonschema
# referencing
certifi==2024.7.4
# via requests
cffi==1.16.0
# via cryptography
charset-normalizer==3.3.2
# via requests
cryptography==43.0.0
# via -r requirements.in
idna==3.7
# via requests
jsonschema==4.23.0
# via -r requirements.in
jsonschema-specifications==2023.12.1
# via jsonschema
ops==2.15.0
# via -r requirements.in
pycparser==2.22
# via cffi
pyyaml==6.0.1
# via ops
referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
requests==2.32.3
# via -r requirements.in
rpds-py==0.18.0
# via
# -r requirements.in
# jsonschema
# referencing
urllib3==2.2.2
# via requests
websocket-client==1.8.0
# via ops
8 changes: 8 additions & 0 deletions test-requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
codespell
coverage[toml]
juju
ops-scenario
pyright
pytest
pytest-operator
ruff
198 changes: 197 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,197 @@
ops-scenario
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --constraint=requirements.txt test-requirements.in
#
asttokens==2.4.1
# via stack-data
bcrypt==4.2.0
# via paramiko
cachetools==5.4.0
# via google-auth
certifi==2024.7.4
# via
# -c requirements.txt
# kubernetes
# requests
cffi==1.16.0
# via
# -c requirements.txt
# cryptography
# pynacl
charset-normalizer==3.3.2
# via
# -c requirements.txt
# requests
codespell==2.3.0
# via -r test-requirements.in
coverage[toml]==7.6.0
# via -r test-requirements.in
cryptography==43.0.0
# via
# -c requirements.txt
# paramiko
decorator==5.1.1
# via
# ipdb
# ipython
executing==2.0.1
# via stack-data
google-auth==2.32.0
# via kubernetes
hvac==2.3.0
# via juju
idna==3.7
# via
# -c requirements.txt
# requests
iniconfig==2.0.0
# via pytest
ipdb==0.13.13
# via pytest-operator
ipython==8.26.0
# via ipdb
jedi==0.19.1
# via ipython
jinja2==3.1.4
# via pytest-operator
juju==3.5.2.0
# via
# -r test-requirements.in
# pytest-operator
kubernetes==30.1.0
# via juju
macaroonbakery==1.3.4
# via juju
markupsafe==2.1.5
# via jinja2
matplotlib-inline==0.1.7
# via ipython
mypy-extensions==1.0.0
# via typing-inspect
nodeenv==1.9.1
# via pyright
oauthlib==3.2.2
# via
# kubernetes
# requests-oauthlib
ops==2.15.0
# via
# -c requirements.txt
# ops-scenario
ops-scenario==6.1.5
# via -r test-requirements.in
packaging==24.1
# via
# juju
# pytest
paramiko==3.4.0
# via juju
parso==0.8.4
# via jedi
pexpect==4.9.0
# via ipython
pluggy==1.5.0
# via pytest
prompt-toolkit==3.0.47
# via ipython
protobuf==5.27.3
# via macaroonbakery
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.3
# via stack-data
pyasn1==0.6.0
# via
# juju
# pyasn1-modules
# rsa
pyasn1-modules==0.4.0
# via google-auth
pycparser==2.22
# via
# -c requirements.txt
# cffi
pygments==2.18.0
# via ipython
pymacaroons==0.13.0
# via macaroonbakery
pynacl==1.5.0
# via
# macaroonbakery
# paramiko
# pymacaroons
pyrfc3339==1.1
# via
# juju
# macaroonbakery
pyright==1.1.374
# via -r test-requirements.in
pytest==8.3.2
# via
# -r test-requirements.in
# pytest-asyncio
# pytest-operator
pytest-asyncio==0.21.2
# via pytest-operator
pytest-operator==0.35.0
# via -r test-requirements.in
python-dateutil==2.9.0.post0
# via kubernetes
pytz==2024.1
# via pyrfc3339
pyyaml==6.0.1
# via
# -c requirements.txt
# juju
# kubernetes
# ops
# ops-scenario
# pytest-operator
requests==2.32.3
# via
# -c requirements.txt
# hvac
# kubernetes
# macaroonbakery
# requests-oauthlib
requests-oauthlib==2.0.0
# via kubernetes
rsa==4.9
# via google-auth
ruff==0.5.6
# via -r test-requirements.in
six==1.16.0
# via
# asttokens
# kubernetes
# macaroonbakery
# pymacaroons
# python-dateutil
stack-data==0.6.3
# via ipython
toposort==1.10
# via juju
traitlets==5.14.3
# via
# ipython
# matplotlib-inline
typing-extensions==4.12.2
# via typing-inspect
typing-inspect==0.9.0
# via juju
urllib3==2.2.2
# via
# -c requirements.txt
# kubernetes
# requests
wcwidth==0.2.13
# via prompt-toolkit
websocket-client==1.8.0
# via
# -c requirements.txt
# kubernetes
# ops
websockets==12.0
# via juju
21 changes: 3 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,29 @@ set_env =
PYTHONPATH = {tox_root}/lib:{[vars]src_path}
PYTHONBREAKPOINT=pdb.set_trace
PY_COLORS=1
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
pass_env =
PYTHONPATH
CHARM_BUILD_DIR
MODEL_SETTINGS

[testenv:format]
description = Apply coding style standards to code
deps =
ruff
commands =
ruff check --fix {[vars]all_path}
ruff format {[vars]all_path}

[testenv:lint]
description = Check code against coding style standards
deps =
ruff
codespell
commands =
codespell {tox_root}
ruff check {[vars]all_path}
ruff format --check {[vars]all_path}

[testenv:unit]
description = Run unit tests
deps =
pytest
coverage[toml]
-r {tox_root}/requirements.txt
-r {tox_root}/test-requirements.txt
commands =
coverage run --source={[vars]src_path} \
-m pytest \
Expand All @@ -59,19 +52,11 @@ commands =

[testenv:static]
description = Run static type checks
deps =
pyright
-r {tox_root}/requirements.txt
commands =
pyright {posargs}

[testenv:integration]
description = Run integration tests
deps =
pytest
juju
pytest-operator
-r {tox_root}/requirements.txt
commands =
pytest -v \
-s \
Expand Down