diff --git a/.editorconfig b/.editorconfig index aab887a..1f557dc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,9 +18,5 @@ insert_final_newline = false [*.py] max_line_length = 100 -[{Makefile,**.mk}] -indent_style = tab -insert_final_newline = false - [*.yml] -indent_style = tab +indent_size = 2 diff --git a/.flake8 b/.flake8 index 29a398a..871c55d 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ # -# Move to pyproject.toml after: https://gitlab.com/pycqa/flake8/-/issues/428 +# Move to pyproject.toml after: https://github.com/PyCQA/flake8/issues/234 # [flake8] exclude = .*, dist, htmlcov, */migrations/*, volumes diff --git a/.github/workflows/ci.yml b/.github/workflows/tests.yml similarity index 82% rename from .github/workflows/ci.yml rename to .github/workflows/tests.yml index 4ad6eb8..cfbea61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,6 @@ -# https://github.com/actions/setup-python -name: Test + +name: tests on: push: @@ -12,15 +12,16 @@ on: jobs: test: - name: 'Python ${{ matrix.python-version }} on ${{ matrix.os }}' - runs-on: ${{ matrix.os }} - env: - PYTHONUNBUFFERED: 1 + runs-on: ubuntu-latest strategy: + max-parallel: 2 fail-fast: false matrix: os: [ubuntu-latest] # TODO: macOS-latest, windows-latest - python-version: ["3.10", "3.9", "3.8", "3.7"] + python-version: ["3.11", "3.10", "3.9"] + env: + PYTHONUNBUFFERED: 1 + PYTHONWARNINGS: always steps: - uses: actions/checkout@v2 with: @@ -36,6 +37,10 @@ jobs: - name: 'Bootstrap' run: | python3 devshell.py quit + - uses: actions/cache@v2 + with: + path: ~/.cache/ + key: dot-cache-files - name: 'Install Browsers for Playwright tests' run: | diff --git a/.gitignore b/.gitignore index f222afb..0cb26f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,11 @@ .* +__pycache__ +coverage.json + !.github +!.editorconfig !.flake8 !.gitignore -!.isort.cfg -!/.travis.yml -!/.style.yapf -!.coveralls.yml # for django-dbbackup /backups/ diff --git a/README.md b/README.md index c9987f5..1d1fa8c 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,8 @@ Files are separated into: "/src/" and "/development/" * [**dev**](https://github.com/jedie/PyInventory/compare/0.17.0...main) * tbc +* [v0.18.0rc1 - *WIP*](https://github.com/jedie/PyInventory/compare/0.17.0...main) + * tbd * [v0.17.0 - 03.10.2022](https://github.com/jedie/PyInventory/compare/v0.16.0...0.17.0) * NEW: List all related objects on `item` change page with edit links. * Change `parent` and `location` fields on `item` change page to a autocompele field. diff --git a/deployment/project.env b/deployment/project.env index 540488d..5f8f243 100644 --- a/deployment/project.env +++ b/deployment/project.env @@ -1,3 +1,3 @@ export PROJECT_NAME=pyinventory export PROJECT_PACKAGE_NAME=pyinventory -export PROJECT_VERSION=0.17.0 +export PROJECT_VERSION=0.18.0rc1 diff --git a/poetry.lock b/poetry.lock index 71466a7..6b92b76 100644 --- a/poetry.lock +++ b/poetry.lock @@ -12,9 +12,6 @@ files = [ {file = "asgiref-3.6.0.tar.gz", hash = "sha256:9567dfe7bd8d3c8c892227827c41cce860b368104c3431da67a0c5a65a949506"}, ] -[package.dependencies] -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} - [package.extras] tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] @@ -131,7 +128,6 @@ mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] @@ -189,18 +185,6 @@ files = [ {file = "bx_py_utils-71.tar.gz", hash = "sha256:ceff6b29b41b6a797b87b3006f94d5394b067a551b004567d4ada7e1a6544806"}, ] -[[package]] -name = "cached-property" -version = "1.5.2" -description = "A decorator for caching properties in classes." -category = "main" -optional = true -python-versions = "*" -files = [ - {file = "cached-property-1.5.2.tar.gz", hash = "sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130"}, - {file = "cached_property-1.5.2-py2.py3-none-any.whl", hash = "sha256:df4f613cf7ad9a588cc381aaf4a512d26265ecebd5eb9e1ba12f1319eb85a6a0"}, -] - [[package]] name = "cachetools" version = "5.2.0" @@ -343,7 +327,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "cmd2" @@ -359,10 +342,8 @@ files = [ [package.dependencies] attrs = ">=16.3.0" -importlib-metadata = {version = ">=1.6.0", markers = "python_version < \"3.8\""} pyperclip = ">=1.6" pyreadline3 = {version = "*", markers = "sys_platform == \"win32\""} -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} wcwidth = ">=0.1.7" [package.extras] @@ -582,7 +563,6 @@ files = [ [package.dependencies] black = ">=21.5b1" toml = ">=0.10.0" -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] color = ["Pygments (>=2.4.0)"] @@ -656,20 +636,20 @@ files = [ [[package]] name = "django" -version = "3.2.16" -description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design." +version = "4.0.8" +description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "Django-3.2.16-py3-none-any.whl", hash = "sha256:18ba8efa36b69cfcd4b670d0fa187c6fe7506596f0ababe580e16909bcdec121"}, - {file = "Django-3.2.16.tar.gz", hash = "sha256:3adc285124244724a394fa9b9839cc8cd116faf7d159554c43ecdaa8cdf0b94d"}, + {file = "Django-4.0.8-py3-none-any.whl", hash = "sha256:27cb08fa6458c1eff8b97c4c2d03774646fb26feeaa4587dca10c49e6d4fc6a3"}, + {file = "Django-4.0.8.tar.gz", hash = "sha256:07e6433f263c3839939cfabeb6d7557841e0419e47759a7b7d37f6d44d40adcb"}, ] [package.dependencies] -asgiref = ">=3.3.2,<4" -pytz = "*" +asgiref = ">=3.4.1,<4" sqlparse = ">=0.2.2" +tzdata = {version = "*", markers = "sys_platform == \"win32\""} [package.extras] argon2 = ["argon2-cffi (>=19.1.0)"] @@ -677,18 +657,18 @@ bcrypt = ["bcrypt"] [[package]] name = "django-admin-sortable2" -version = "1.0.4" +version = "2.1.4" description = "Generic drag-and-drop sorting for the List, the Stacked- and the Tabular-Inlines Views in the Django Admin" category = "main" optional = false python-versions = "*" files = [ - {file = "django-admin-sortable2-1.0.4.tar.gz", hash = "sha256:f96044003176c6684c5f969792ca833a505d654fa0f7b24232a0a610e4332a53"}, - {file = "django_admin_sortable2-1.0.4-py3-none-any.whl", hash = "sha256:e22956889533b48a35a7f02859ae3a939753fa9a7d7d532cefc2835b41bdcebb"}, + {file = "django-admin-sortable2-2.1.4.tar.gz", hash = "sha256:7dc08ff0fbce5859502f809d108c0495f3b0d94609269eaedbb1237e03084acb"}, + {file = "django_admin_sortable2-2.1.4-py3-none-any.whl", hash = "sha256:93d7951fadfeb1a31bed382e78adbf015f30018429a3287bd4343e343fa10aa8"}, ] [package.dependencies] -Django = ">=2.2,<4.1" +Django = ">=4.0" [[package]] name = "django-axes" @@ -709,18 +689,19 @@ setuptools = "*" [[package]] name = "django-ckeditor" -version = "6.3.0" +version = "6.5.1" description = "Django admin CKEditor integration." category = "main" optional = false -python-versions = "*" +python-versions = ">=3.8" files = [ - {file = "django-ckeditor-6.3.0.tar.gz", hash = "sha256:d04f350f4a200c2a0f96307fc8827bd4e87af5694fb12d53189ba92025b2da37"}, - {file = "django_ckeditor-6.3.0-py2.py3-none-any.whl", hash = "sha256:b5c03d77b9fe848bf12520512a82d07533afa8678040731b1d4d86c1dcea8344"}, + {file = "django-ckeditor-6.5.1.tar.gz", hash = "sha256:57cd8fb7cd150adca354cd4e5c35a743fadaab7073f957d2b7167f0d9fe1fcaf"}, + {file = "django_ckeditor-6.5.1-py3-none-any.whl", hash = "sha256:1321f24df392f30698513930ce5c9f6d899f9bd0ef734c3b64fe936d809e11b3"}, ] [package.dependencies] -django-js-asset = ">=1.2.2" +Django = ">=3.2" +django-js-asset = ">=2.0" [[package]] name = "django-dbbackup" @@ -917,7 +898,6 @@ files = [ ] [package.dependencies] -cached-property = {version = ">=1.2.0,<2", markers = "python_version < \"3.8\""} colorama = {version = ">=0.4,<1", markers = "sys_platform == \"win32\""} distro = ">=1.5.0,<2" docker = {version = ">=5", extras = ["ssh"]} @@ -971,6 +951,26 @@ files = [ {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"}, ] +[[package]] +name = "dparse" +version = "0.6.2" +description = "A parser for Python dependency files" +category = "dev" +optional = false +python-versions = ">=3.5" +files = [ + {file = "dparse-0.6.2-py3-none-any.whl", hash = "sha256:8097076f1dd26c377f30d4745e6ec18fef42f3bf493933b842ac5bafad8c345f"}, + {file = "dparse-0.6.2.tar.gz", hash = "sha256:d45255bda21f998bc7ddf2afd5e62505ba6134756ba2d42a84c56b0826614dfe"}, +] + +[package.dependencies] +packaging = "*" +toml = "*" + +[package.extras] +conda = ["pyyaml"] +pipenv = ["pipenv"] + [[package]] name = "editorconfig" version = "0.12.3" @@ -1028,21 +1028,20 @@ testing = ["covdefaults (>=2.2.2)", "coverage (>=6.5)", "pytest (>=7.2)", "pytes [[package]] name = "flake8" -version = "3.9.2" +version = "6.0.0" description = "the modular source code checker: pep8 pyflakes and co" category = "dev" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +python-versions = ">=3.8.1" files = [ - {file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"}, - {file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"}, + {file = "flake8-6.0.0-py2.py3-none-any.whl", hash = "sha256:3833794e27ff64ea4e9cf5d410082a8b97ff1a06c16aa3d2027339cd0f1195c7"}, + {file = "flake8-6.0.0.tar.gz", hash = "sha256:c61007e76655af75e6785a931f452915b371dc48f56efd765247c8fe68f2b181"}, ] [package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} -mccabe = ">=0.6.0,<0.7.0" -pycodestyle = ">=2.7.0,<2.8.0" -pyflakes = ">=2.3.0,<2.4.0" +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.10.0,<2.11.0" +pyflakes = ">=3.0.0,<3.1.0" [[package]] name = "flynt" @@ -1222,7 +1221,7 @@ files = [ name = "importlib-metadata" version = "5.2.0" description = "Read metadata from Python packages" -category = "main" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1231,7 +1230,6 @@ files = [ ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] @@ -1239,25 +1237,6 @@ docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker perf = ["ipython"] testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] -[[package]] -name = "importlib-resources" -version = "5.10.1" -description = "Read resources from Python packages" -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "importlib_resources-5.10.1-py3-none-any.whl", hash = "sha256:c09b067d82e72c66f4f8eb12332f5efbebc9b007c0b6c40818108c9870adc363"}, - {file = "importlib_resources-5.10.1.tar.gz", hash = "sha256:32bb095bda29741f6ef0e5278c42df98d135391bee5f932841efc0041f748dc3"}, -] - -[package.dependencies] -zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] -testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] - [[package]] name = "iniconfig" version = "1.1.1" @@ -1337,7 +1316,6 @@ files = [ [package.dependencies] attrs = ">=17.4.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} pyrsistent = ">=0.14.0" setuptools = "*" six = ">=1.11.0" @@ -1360,7 +1338,6 @@ files = [ [package.dependencies] importlib-metadata = {version = ">=4.11.4", markers = "python_version < \"3.12\""} -importlib-resources = {version = "*", markers = "python_version < \"3.9\""} "jaraco.classes" = "*" jeepney = {version = ">=0.4.2", markers = "sys_platform == \"linux\""} pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""} @@ -1477,14 +1454,14 @@ files = [ [[package]] name = "mccabe" -version = "0.6.1" +version = "0.7.0" description = "McCabe checker, plugin for flake8" category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, - {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, ] [[package]] @@ -1514,6 +1491,57 @@ files = [ {file = "more_itertools-9.0.0-py3-none-any.whl", hash = "sha256:250e83d7e81d0c87ca6bd942e6aeab8cc9daa6096d12c5308f3f92fa5e5c1f41"}, ] +[[package]] +name = "mypy" +version = "0.991" +description = "Optional static typing for Python" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mypy-0.991-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7d17e0a9707d0772f4a7b878f04b4fd11f6f5bcb9b3813975a9b13c9332153ab"}, + {file = "mypy-0.991-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0714258640194d75677e86c786e80ccf294972cc76885d3ebbb560f11db0003d"}, + {file = "mypy-0.991-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0c8f3be99e8a8bd403caa8c03be619544bc2c77a7093685dcf308c6b109426c6"}, + {file = "mypy-0.991-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc9ec663ed6c8f15f4ae9d3c04c989b744436c16d26580eaa760ae9dd5d662eb"}, + {file = "mypy-0.991-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4307270436fd7694b41f913eb09210faff27ea4979ecbcd849e57d2da2f65305"}, + {file = "mypy-0.991-cp310-cp310-win_amd64.whl", hash = "sha256:901c2c269c616e6cb0998b33d4adbb4a6af0ac4ce5cd078afd7bc95830e62c1c"}, + {file = "mypy-0.991-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d13674f3fb73805ba0c45eb6c0c3053d218aa1f7abead6e446d474529aafc372"}, + {file = "mypy-0.991-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1c8cd4fb70e8584ca1ed5805cbc7c017a3d1a29fb450621089ffed3e99d1857f"}, + {file = "mypy-0.991-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:209ee89fbb0deed518605edddd234af80506aec932ad28d73c08f1400ef80a33"}, + {file = "mypy-0.991-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37bd02ebf9d10e05b00d71302d2c2e6ca333e6c2a8584a98c00e038db8121f05"}, + {file = "mypy-0.991-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:26efb2fcc6b67e4d5a55561f39176821d2adf88f2745ddc72751b7890f3194ad"}, + {file = "mypy-0.991-cp311-cp311-win_amd64.whl", hash = "sha256:3a700330b567114b673cf8ee7388e949f843b356a73b5ab22dd7cff4742a5297"}, + {file = "mypy-0.991-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:1f7d1a520373e2272b10796c3ff721ea1a0712288cafaa95931e66aa15798813"}, + {file = "mypy-0.991-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:641411733b127c3e0dab94c45af15fea99e4468f99ac88b39efb1ad677da5711"}, + {file = "mypy-0.991-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3d80e36b7d7a9259b740be6d8d906221789b0d836201af4234093cae89ced0cd"}, + {file = "mypy-0.991-cp37-cp37m-win_amd64.whl", hash = "sha256:e62ebaad93be3ad1a828a11e90f0e76f15449371ffeecca4a0a0b9adc99abcef"}, + {file = "mypy-0.991-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:b86ce2c1866a748c0f6faca5232059f881cda6dda2a893b9a8373353cfe3715a"}, + {file = "mypy-0.991-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ac6e503823143464538efda0e8e356d871557ef60ccd38f8824a4257acc18d93"}, + {file = "mypy-0.991-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0cca5adf694af539aeaa6ac633a7afe9bbd760df9d31be55ab780b77ab5ae8bf"}, + {file = "mypy-0.991-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a12c56bf73cdab116df96e4ff39610b92a348cc99a1307e1da3c3768bbb5b135"}, + {file = "mypy-0.991-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:652b651d42f155033a1967739788c436491b577b6a44e4c39fb340d0ee7f0d70"}, + {file = "mypy-0.991-cp38-cp38-win_amd64.whl", hash = "sha256:4175593dc25d9da12f7de8de873a33f9b2b8bdb4e827a7cae952e5b1a342e243"}, + {file = "mypy-0.991-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:98e781cd35c0acf33eb0295e8b9c55cdbef64fcb35f6d3aa2186f289bed6e80d"}, + {file = "mypy-0.991-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6d7464bac72a85cb3491c7e92b5b62f3dcccb8af26826257760a552a5e244aa5"}, + {file = "mypy-0.991-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c9166b3f81a10cdf9b49f2d594b21b31adadb3d5e9db9b834866c3258b695be3"}, + {file = "mypy-0.991-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8472f736a5bfb159a5e36740847808f6f5b659960115ff29c7cecec1741c648"}, + {file = "mypy-0.991-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e80e758243b97b618cdf22004beb09e8a2de1af481382e4d84bc52152d1c476"}, + {file = "mypy-0.991-cp39-cp39-win_amd64.whl", hash = "sha256:74e259b5c19f70d35fcc1ad3d56499065c601dfe94ff67ae48b85596b9ec1461"}, + {file = "mypy-0.991-py3-none-any.whl", hash = "sha256:de32edc9b0a7e67c2775e574cb061a537660e51210fbf6006b0b36ea695ae9bb"}, + {file = "mypy-0.991.tar.gz", hash = "sha256:3c0165ba8f354a6d9881809ef29f1a9318a236a6d81c690094c5df32107bde06"}, +] + +[package.dependencies] +mypy-extensions = ">=0.4.3" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=3.10" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +install-types = ["pip"] +python2 = ["typed-ast (>=1.4.0,<2)"] +reports = ["lxml"] + [[package]] name = "mypy-extensions" version = "0.4.3" @@ -1729,7 +1757,6 @@ files = [ [package.dependencies] greenlet = "2.0.1" pyee = "9.0.4" -typing-extensions = {version = "*", markers = "python_version <= \"3.8\""} [[package]] name = "pluggy" @@ -1743,9 +1770,6 @@ files = [ {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -1884,14 +1908,14 @@ files = [ [[package]] name = "pycodestyle" -version = "2.7.0" +version = "2.10.0" description = "Python style guide checker" category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.6" files = [ - {file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"}, - {file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"}, + {file = "pycodestyle-2.10.0-py2.py3-none-any.whl", hash = "sha256:8a4eaf0d0495c7395bdab3589ac2db602797d76207242c17d470186815706610"}, + {file = "pycodestyle-2.10.0.tar.gz", hash = "sha256:347187bdb476329d98f695c213d7295a846d1152ff4fe9bacb8a9590b8ee7053"}, ] [[package]] @@ -1923,14 +1947,14 @@ typing-extensions = "*" [[package]] name = "pyflakes" -version = "2.3.1" +version = "3.0.1" description = "passive checker of Python programs" category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.6" files = [ - {file = "pyflakes-2.3.1-py2.py3-none-any.whl", hash = "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3"}, - {file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"}, + {file = "pyflakes-3.0.1-py2.py3-none-any.whl", hash = "sha256:ec55bf7fe21fff7f1ad2f7da62363d749e2a470500eab1b555334b67aa1ef8cf"}, + {file = "pyflakes-3.0.1.tar.gz", hash = "sha256:ec8b276a6b60bd80defed25add7e439881c19e64850afd9b346283d4165fd0fd"}, ] [[package]] @@ -2066,7 +2090,6 @@ files = [ attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -2110,25 +2133,6 @@ pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] -[[package]] -name = "pytest-darker" -version = "0.1.2" -description = "A pytest plugin for checking of modified code using Darker" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "pytest_darker-0.1.2-py3-none-any.whl", hash = "sha256:ec7bad719510f0ac2d3d9aeb698cf6d5fb88b76e43b0bc1ee0cfb125332abcfd"}, - {file = "pytest_darker-0.1.2.tar.gz", hash = "sha256:79d725b55e346bfb00304485184ba978723d99c4e475d73547074303255f7544"}, -] - -[package.dependencies] -darker = ">=1.1.0" -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} - -[package.extras] -test = ["mypy (>=0.782)", "pytest (>=6.0.1)", "pytest-black", "pytest-isort (>=1.1.0)", "pytest-mypy"] - [[package]] name = "pytest-django" version = "4.5.2" @@ -2456,11 +2460,97 @@ files = [ [package.dependencies] commonmark = ">=0.9.0,<0.10.0" pygments = ">=2.6.0,<3.0.0" -typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} [package.extras] jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] +[[package]] +name = "ruamel-yaml" +version = "0.17.21" +description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" +category = "dev" +optional = false +python-versions = ">=3" +files = [ + {file = "ruamel.yaml-0.17.21-py3-none-any.whl", hash = "sha256:742b35d3d665023981bd6d16b3d24248ce5df75fdb4e2924e93a05c1f8b61ca7"}, + {file = "ruamel.yaml-0.17.21.tar.gz", hash = "sha256:8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af"}, +] + +[package.dependencies] +"ruamel.yaml.clib" = {version = ">=0.2.6", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.11\""} + +[package.extras] +docs = ["ryd"] +jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] + +[[package]] +name = "ruamel-yaml-clib" +version = "0.2.7" +description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" +category = "dev" +optional = false +python-versions = ">=3.5" +files = [ + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d5859983f26d8cd7bb5c287ef452e8aacc86501487634573d260968f753e1d71"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:debc87a9516b237d0466a711b18b6ebeb17ba9f391eb7f91c649c5c4ec5006c7"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:df5828871e6648db72d1c19b4bd24819b80a755c4541d3409f0f7acd0f335c80"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:efa08d63ef03d079dcae1dfe334f6c8847ba8b645d08df286358b1f5293d24ab"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-win32.whl", hash = "sha256:763d65baa3b952479c4e972669f679fe490eee058d5aa85da483ebae2009d231"}, + {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-win_amd64.whl", hash = "sha256:d000f258cf42fec2b1bbf2863c61d7b8918d31ffee905da62dede869254d3b8a"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:045e0626baf1c52e5527bd5db361bc83180faaba2ff586e763d3d5982a876a9e"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_12_6_arm64.whl", hash = "sha256:721bc4ba4525f53f6a611ec0967bdcee61b31df5a56801281027a3a6d1c2daf5"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:41d0f1fa4c6830176eef5b276af04c89320ea616655d01327d5ce65e50575c94"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:4b3a93bb9bc662fc1f99c5c3ea8e623d8b23ad22f861eb6fce9377ac07ad6072"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-macosx_12_0_arm64.whl", hash = "sha256:a234a20ae07e8469da311e182e70ef6b199d0fbeb6c6cc2901204dd87fb867e8"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:15910ef4f3e537eea7fe45f8a5d19997479940d9196f357152a09031c5be59f3"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:370445fd795706fd291ab00c9df38a0caed0f17a6fb46b0f607668ecb16ce763"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-win32.whl", hash = "sha256:ecdf1a604009bd35c674b9225a8fa609e0282d9b896c03dd441a91e5f53b534e"}, + {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-win_amd64.whl", hash = "sha256:f34019dced51047d6f70cb9383b2ae2853b7fc4dce65129a5acd49f4f9256646"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2aa261c29a5545adfef9296b7e33941f46aa5bbd21164228e833412af4c9c75f"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-macosx_12_0_arm64.whl", hash = "sha256:f01da5790e95815eb5a8a138508c01c758e5f5bc0ce4286c4f7028b8dd7ac3d0"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:40d030e2329ce5286d6b231b8726959ebbe0404c92f0a578c0e2482182e38282"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:c3ca1fbba4ae962521e5eb66d72998b51f0f4d0f608d3c0347a48e1af262efa7"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-win32.whl", hash = "sha256:7bdb4c06b063f6fd55e472e201317a3bb6cdeeee5d5a38512ea5c01e1acbdd93"}, + {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-win_amd64.whl", hash = "sha256:be2a7ad8fd8f7442b24323d24ba0b56c51219513cfa45b9ada3b87b76c374d4b"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:91a789b4aa0097b78c93e3dc4b40040ba55bef518f84a40d4442f713b4094acb"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:99e77daab5d13a48a4054803d052ff40780278240a902b880dd37a51ba01a307"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:3243f48ecd450eddadc2d11b5feb08aca941b5cd98c9b1db14b2fd128be8c697"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:8831a2cedcd0f0927f788c5bdf6567d9dc9cc235646a434986a852af1cb54b4b"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-win32.whl", hash = "sha256:3110a99e0f94a4a3470ff67fc20d3f96c25b13d24c6980ff841e82bafe827cac"}, + {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-win_amd64.whl", hash = "sha256:92460ce908546ab69770b2e576e4f99fbb4ce6ab4b245345a3869a0a0410488f"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5bc0667c1eb8f83a3752b71b9c4ba55ef7c7058ae57022dd9b29065186a113d9"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:4a4d8d417868d68b979076a9be6a38c676eca060785abaa6709c7b31593c35d1"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:bf9a6bc4a0221538b1a7de3ed7bca4c93c02346853f44e1cd764be0023cd3640"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a7b301ff08055d73223058b5c46c55638917f04d21577c95e00e0c4d79201a6b"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-win32.whl", hash = "sha256:d5e51e2901ec2366b79f16c2299a03e74ba4531ddcfacc1416639c557aef0ad8"}, + {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-win_amd64.whl", hash = "sha256:184faeaec61dbaa3cace407cffc5819f7b977e75360e8d5ca19461cd851a5fc5"}, + {file = "ruamel.yaml.clib-0.2.7.tar.gz", hash = "sha256:1f08fd5a2bea9c4180db71678e850b995d2a5f4537be0e94557668cf0f5f9497"}, +] + +[[package]] +name = "safety" +version = "2.3.4" +description = "Checks installed dependencies for known vulnerabilities and licenses." +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "safety-2.3.4-py3-none-any.whl", hash = "sha256:6224dcd9b20986a2b2c5e7acfdfba6bca42bb11b2783b24ed04f32317e5167ea"}, + {file = "safety-2.3.4.tar.gz", hash = "sha256:b9e74e794e82f54d11f4091c5d820c4d2d81de9f953bf0b4f33ac8bc402ae72c"}, +] + +[package.dependencies] +Click = ">=8.0.2" +dparse = ">=0.6.2" +packaging = ">=21.0" +requests = "*" +"ruamel.yaml" = ">=0.17.21" +setuptools = ">=19.3" + +[package.extras] +github = ["jinja2 (>=3.1.0)", "pygithub (>=1.43.3)"] +gitlab = ["python-gitlab (>=1.3.0)"] + [[package]] name = "secretstorage" version = "3.3.3" @@ -2637,13 +2727,11 @@ cachetools = ">=5.2" chardet = ">=5.1" colorama = ">=0.4.6" filelock = ">=3.8.2" -importlib-metadata = {version = ">=5.2", markers = "python_version < \"3.8\""} packaging = ">=22" platformdirs = ">=2.6" pluggy = ">=1" pyproject-api = ">=1.2.1" tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.4", markers = "python_version < \"3.8\""} virtualenv = ">=20.17.1" [package.extras] @@ -2673,45 +2761,11 @@ rfc3986 = ">=1.4.0" rich = ">=12.0.0" urllib3 = ">=1.26.0" -[[package]] -name = "typed-ast" -version = "1.5.4" -description = "a fork of Python 2 and 3 ast modules with type comment support" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typed_ast-1.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:669dd0c4167f6f2cd9f57041e03c3c2ebf9063d0757dc89f79ba1daa2bfca9d4"}, - {file = "typed_ast-1.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:211260621ab1cd7324e0798d6be953d00b74e0428382991adfddb352252f1d62"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:267e3f78697a6c00c689c03db4876dd1efdfea2f251a5ad6555e82a26847b4ac"}, - {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c542eeda69212fa10a7ada75e668876fdec5f856cd3d06829e6aa64ad17c8dfe"}, - {file = "typed_ast-1.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:a9916d2bb8865f973824fb47436fa45e1ebf2efd920f2b9f99342cb7fab93f72"}, - {file = "typed_ast-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:79b1e0869db7c830ba6a981d58711c88b6677506e648496b1f64ac7d15633aec"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a94d55d142c9265f4ea46fab70977a1944ecae359ae867397757d836ea5a3f47"}, - {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:183afdf0ec5b1b211724dfef3d2cad2d767cbefac291f24d69b00546c1837fb6"}, - {file = "typed_ast-1.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:639c5f0b21776605dd6c9dbe592d5228f021404dafd377e2b7ac046b0349b1a1"}, - {file = "typed_ast-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cf4afcfac006ece570e32d6fa90ab74a17245b83dfd6655a6f68568098345ff6"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed855bbe3eb3715fca349c80174cfcfd699c2f9de574d40527b8429acae23a66"}, - {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6778e1b2f81dfc7bc58e4b259363b83d2e509a65198e85d5700dfae4c6c8ff1c"}, - {file = "typed_ast-1.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:0261195c2062caf107831e92a76764c81227dae162c4f75192c0d489faf751a2"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2efae9db7a8c05ad5547d522e7dbe62c83d838d3906a3716d1478b6c1d61388d"}, - {file = "typed_ast-1.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7d5d014b7daa8b0bf2eaef684295acae12b036d79f54178b92a2b6a56f92278f"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:370788a63915e82fd6f212865a596a0fefcbb7d408bbbb13dea723d971ed8bdc"}, - {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4e964b4ff86550a7a7d56345c7864b18f403f5bd7380edf44a3c1fb4ee7ac6c6"}, - {file = "typed_ast-1.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:683407d92dc953c8a7347119596f0b0e6c55eb98ebebd9b23437501b28dcbb8e"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4879da6c9b73443f97e731b617184a596ac1235fe91f98d279a7af36c796da35"}, - {file = "typed_ast-1.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3e123d878ba170397916557d31c8f589951e353cc95fb7f24f6bb69adc1a8a97"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebd9d7f80ccf7a82ac5f88c521115cc55d84e35bf8b446fcd7836eb6b98929a3"}, - {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98f80dee3c03455e92796b58b98ff6ca0b2a6f652120c263efdba4d6c5e58f72"}, - {file = "typed_ast-1.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:0fdbcf2fef0ca421a3f5912555804296f0b0960f0418c440f5d6d3abb549f3e1"}, - {file = "typed_ast-1.5.4.tar.gz", hash = "sha256:39e21ceb7388e4bb37f4c679d72707ed46c2fbf2a5609b8b8ebc4b067d977df2"}, -] - [[package]] name = "typing-extensions" version = "4.4.0" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "main" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2719,6 +2773,18 @@ files = [ {file = "typing_extensions-4.4.0.tar.gz", hash = "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa"}, ] +[[package]] +name = "tzdata" +version = "2022.7" +description = "Provider of IANA time zone data" +category = "main" +optional = false +python-versions = ">=2" +files = [ + {file = "tzdata-2022.7-py2.py3-none-any.whl", hash = "sha256:2b88858b0e3120792a3c0635c23daf36a7d7eeeca657c323da299d2094402a0d"}, + {file = "tzdata-2022.7.tar.gz", hash = "sha256:fe5f866eddd8b96e9fcba978f8e503c909b19ea7efda11e52e39494bad3a7bfa"}, +] + [[package]] name = "urllib3" version = "1.26.13" @@ -2751,7 +2817,6 @@ files = [ [package.dependencies] distlib = ">=0.3.6,<1" filelock = ">=3.4.1,<4" -importlib-metadata = {version = ">=4.8.3", markers = "python_version < \"3.8\""} platformdirs = ">=2.4,<3" [package.extras] @@ -2830,7 +2895,7 @@ files = [ name = "zipp" version = "3.11.0" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "main" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2843,11 +2908,10 @@ docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] [extras] -docker = ["docker-compose"] postgres-binary = ["psycopg2-binary"] psycopg2-source = ["psycopg2"] [metadata] lock-version = "2.0" -python-versions = ">=3.7,<4.0.0" -content-hash = "6d8921c023a698c5daf4e99e986c8c6e0023953a80be0f4c68416bc3aba3e7d7" +python-versions = ">=3.9,<4.0.0" # Stay with 3.9 until YunoHost used >=Debian 11 (Bullseye) +content-hash = "1ab25c6d2d2a85e3a9cea62f23787da6cbe4bf823fc32ad0e0fb641221b4a306" diff --git a/pyproject.toml b/pyproject.toml index 9084d28..e153045 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,13 @@ [tool.poetry] name = "PyInventory" -version = "0.17.0" +version = "0.18.0rc1" description = "Web based management to catalog things including state and location etc. using Python/Django." -authors = ["JensDiemer "] +authors = [ + "Jens Diemer ", +] +maintainers = [ + "Jens Diemer ", +] homepage = "https://github.com/jedie/PyInventory" packages = [ { include = "inventory", from = "src" }, @@ -29,32 +34,26 @@ classifiers = [ "Operating System :: OS Independent", ] include = ['AUTHORS', 'LICENSE'] -readme='README.md' +license = "GPL-3.0-or-later" +readme = 'README.md' +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/jedie/PyInventory/issues" -# FIXME: Invalid value for project_urls. Error: Use valid URL. -#[tool.poetry.urls] -#"Bug Tracker" = "https://github.com/jedie/PyInventory/issues" - -license = "GPL" [tool.poetry.dependencies] -# Keep Python 3.7 until Yunohost contains a newer Python Version ;) -python = ">=3.7,<4.0.0" -django = "*" +python = ">=3.9,<4.0.0" # Stay with 3.9 until YunoHost used >=Debian 11 (Bullseye) + +django = "<4.1" # FIXME: https://github.com/jedie/django-processinfo/issues/19 + colorlog = "*" # https://github.com/borntyping/python-colorlog gunicorn = "*" # https://github.com/benoimyproject.wsgitc/gunicorn django-processinfo = "*" # https://github.com/jedie/django-processinfo/ django-debug-toolbar = "*" # http://django-debug-toolbar.readthedocs.io/en/stable/changes.html django-import-export = "*" # https://github.com/django-import-export/django-import-export django-dbbackup = "*" # https://github.com/django-dbbackup/django-dbbackup -django-tools = ">=0.49.0" # https://github.com/jedie/django-tools/ +django-tools = "*" # https://github.com/jedie/django-tools/ django-reversion-compare = "*" # https://github.com/jedie/django-reversion-compare/ - -# Skip Version 6.3.1-6.3.x -# Because [1] brokes the form widget! -# [1] https://github.com/django-ckeditor/django-ckeditor/commit/6665cb73a11d37216cd83c4b9e85bf4291fa73e6 -django-ckeditor = "<=6.3.0,<=6.4.0" # https://github.com/django-ckeditor/django-ckeditor - +django-ckeditor = "*" # https://github.com/django-ckeditor/django-ckeditor bx_py_utils = "*" # https://github.com/boxine/bx_py_utils bx_django_utils = "*" # https://github.com/boxine/bx_django_utils django-tagulous = "*" # https://github.com/radiac/django-tagulous @@ -70,35 +69,34 @@ psycopg2 = { version = "*", optional = true } # install via: poetry install --e [tool.poetry.extras] -docker = ["docker-compose"] postgres-binary = ["psycopg2-binary"] psycopg2-source = ["psycopg2"] [tool.poetry.dev-dependencies] dev_shell = "*" # https://github.com/jedie/dev-shell -poetry-publish = "*" # https://github.com/jedie/poetry-publish cmd2_ext_test = "*" -tox = "*" pytest = "*" pytest-randomly = "*" pytest-cov = "*" pytest-django = "*" -pytest-darker = "*" # https://github.com/akaihola/pytest-darker -# TODO: pytest-mypy = "*" pytest-playwright = "*" # https://playwright.dev/python/docs/test-runners -coveralls = "*" -isort = "*" -flake8 = "*" flynt = "*" -darker = "*" # https://github.com/akaihola/darker pyupgrade = "*" model_bakery = "*" # https://github.com/model-bakers/model_bakery beautifulsoup4 = "*" lxml = "*" requests-mock = "*" +tox = "*" # https://github.com/tox-dev/tox +coveralls = "*" # http://github.com/TheKevJames/coveralls-python +darker = "*" # https://github.com/akaihola/pytest-darker +isort = "*" # https://github.com/pycqa/isort +flake8 = "*" # https://github.com/pycqa/flake8 EditorConfig = "*" # https://github.com/editorconfig/editorconfig-core-py +safety = "*" # https://github.com/pyupio/safety +mypy = "*" # https://github.com/python/mypy tomli = "*" # https://github.com/hukkin/tomli packaging = "*" # https://github.com/pypa/packaging +poetry-publish = "*" # https://github.com/jedie/poetry-publish [tool.poetry.scripts] @@ -107,7 +105,7 @@ run_testserver = 'inventory_project.manage:start_test_server' [build-system] -requires = ["poetry-core>=1.0.0"] +requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" @@ -135,7 +133,7 @@ line_length = 100 # https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format atomic=true profile='black' -line_length=100 +line_length = 100 skip_glob=[".*", "*/htmlcov/*","*/migrations/*","*/volumes/*"] known_first_party=["inventory","inventory_project","inventory_tests"] lines_after_imports=2 @@ -175,7 +173,6 @@ addopts = """ --cov-report xml --no-cov-on-fail --showlocals - --darker --doctest-modules --failed-first --last-failed-no-failures all @@ -190,7 +187,7 @@ addopts = """ legacy_tox_ini = """ [tox] isolated_build = True -envlist = py{37,38,39,310} +envlist = py{39,310,311} skip_missing_interpreters = True [testenv] @@ -201,3 +198,31 @@ commands = poetry run django-admin --version python devshell.py pytest """ + + +[tool.mypy] +warn_unused_configs = true +ignore_missing_imports = true +allow_redefinition = true # https://github.com/python/mypy/issues/7165 +show_error_codes = true +plugins = [] +exclude = ['.venv', 'tests'] + + +[manageprojects] # https://github.com/jedie/manageprojects +initial_revision = "b33d693" +initial_date = 2022-12-21T22:53:08+01:00 +cookiecutter_template = "https://github.com/jedie/cookiecutter_templates/" +cookiecutter_directory = "poetry-python" + +[manageprojects.cookiecutter_context.cookiecutter] +full_name = "Jens Diemer" +github_username = "jedie" +author_email = "PyInventory@jensdiemer.de" +package_name = "PyInventory" +package_version = "0.18.0" +package_description = "Web based management to catalog things including state and location etc. using Python/Django." +package_url = "https://github.com/jedie/PyInventory" +issues_url = "https://github.com/jedie/PyInventory/issues" +license = "GPL-3.0-or-later" +_template = "https://github.com/jedie/cookiecutter_templates/" diff --git a/src/inventory/__init__.py b/src/inventory/__init__.py index 4a57ecb..e9d0584 100644 --- a/src/inventory/__init__.py +++ b/src/inventory/__init__.py @@ -4,4 +4,7 @@ :license: GNU GPL v3 or above, see LICENSE for more details. """ -__version__ = "0.17.0" +from importlib.metadata import version + + +__version__ = version('PyInventory') diff --git a/src/inventory/admin/item.py b/src/inventory/admin/item.py index a42b86a..cbe996f 100644 --- a/src/inventory/admin/item.py +++ b/src/inventory/admin/item.py @@ -1,7 +1,7 @@ import logging import tagulous -from adminsortable2.admin import SortableInlineAdminMixin +from adminsortable2.admin import SortableAdminMixin, SortableInlineAdminMixin from django.conf import settings from django.contrib import admin from django.template.loader import render_to_string @@ -18,6 +18,7 @@ from inventory.admin.base import ( LimitTreeDepthListFilter, UserInlineMixin, ) +from inventory.admin.tagulous_fix import TagulousModelAdminFix from inventory.models import ItemLinkModel, ItemModel from inventory.models.item import ItemFileModel, ItemImageModel from inventory.string_utils import ltruncatechars @@ -45,7 +46,7 @@ class ItemModelResource(ModelResource): @admin.register(ItemModel) -class ItemModelAdmin(ImportExportMixin, BaseUserAdmin): +class ItemModelAdmin(TagulousModelAdminFix, ImportExportMixin, SortableAdminMixin, BaseUserAdmin): @admin.display(description=_('Related items')) def related_items(self, obj): if obj.pk is None: @@ -85,10 +86,14 @@ class ItemModelAdmin(ImportExportMixin, BaseUserAdmin): ) return qs + def get_max_order(self, request, obj=None): + # Work-a-round for: https://github.com/jrief/django-admin-sortable2/issues/341 + return 0 + date_hierarchy = 'create_dt' list_display = ('item', 'kind', 'producer', 'location', 'received_date', 'update_dt') ordering = ('path_str',) - list_display_links = None + list_display_links = () list_filter = (LimitTreeDepthListFilter, 'kind', 'location', 'producer', 'tags') search_fields = ('name', 'description', 'kind__name', 'tags__name') fieldsets = ( diff --git a/src/inventory/admin/memo.py b/src/inventory/admin/memo.py index 58f6458..ef265b3 100644 --- a/src/inventory/admin/memo.py +++ b/src/inventory/admin/memo.py @@ -1,7 +1,7 @@ import logging import tagulous -from adminsortable2.admin import SortableInlineAdminMixin +from adminsortable2.admin import SortableAdminMixin, SortableInlineAdminMixin from django.contrib import admin from django.utils.translation import gettext_lazy as _ from import_export.admin import ImportExportMixin @@ -13,6 +13,7 @@ from inventory.admin.base import ( BaseUserAdmin, UserInlineMixin, ) +from inventory.admin.tagulous_fix import TagulousModelAdminFix from inventory.models import MemoLinkModel, MemoModel from inventory.models.memo import MemoFileModel, MemoImageModel @@ -39,7 +40,11 @@ class MemoModelResource(ModelResource): @admin.register(MemoModel) -class MemoModelAdmin(ImportExportMixin, BaseUserAdmin): +class MemoModelAdmin(TagulousModelAdminFix, ImportExportMixin, SortableAdminMixin, BaseUserAdmin): + def get_max_order(self, request, obj=None): + # Work-a-round for: https://github.com/jrief/django-admin-sortable2/issues/341 + return 0 + date_hierarchy = 'create_dt' list_display = ( 'name', 'update_dt' diff --git a/src/inventory/admin/tagulous_fix.py b/src/inventory/admin/tagulous_fix.py new file mode 100644 index 0000000..570c641 --- /dev/null +++ b/src/inventory/admin/tagulous_fix.py @@ -0,0 +1,45 @@ +""" + Work-a-round for: + https://github.com/radiac/django-tagulous/issues/164 +""" +from django import forms +from django.contrib.admin.widgets import AutocompleteMixin +from tagulous import settings as tagulous_settings +from tagulous.forms import AdminTagWidget, BaseTagField +from tagulous.models import SingleTagField, TagField + + +class AdminTagWidget2(AdminTagWidget): + @property + def media(self): + # Get the media from the AutocompleteMixin - this will give us Django's + # vendor jQuery and select2 + class GetMedia(AutocompleteMixin, forms.Select): + pass + + dependency_media = GetMedia(None, None).media + tagulous_media = forms.Media( + js=tagulous_settings.ADMIN_AUTOCOMPLETE_JS, + css=tagulous_settings.ADMIN_AUTOCOMPLETE_CSS, + ) + all_media = dependency_media + tagulous_media + + return all_media + + +class BaseTagField2(BaseTagField): + widget = AdminTagWidget2 + + +class TagulousModelAdminFix: + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + self.formfield_overrides[SingleTagField] = { + 'form_class': BaseTagField2, + 'widget': AdminTagWidget2, + } + self.formfield_overrides[TagField] = { + 'form_class': BaseTagField2, + 'widget': AdminTagWidget2, + } diff --git a/src/inventory_project/dev_shell.py b/src/inventory_project/dev_shell.py index 8f00dab..cc10a0e 100644 --- a/src/inventory_project/dev_shell.py +++ b/src/inventory_project/dev_shell.py @@ -62,7 +62,7 @@ class PyInventoryCommandSet(DevShellBaseCommandSet): """ # Start the "[tool.poetry.scripts]" script via subprocess # This works good with django dev server reloads - verbose_check_call('run_testserver', *statement.arg_list, cwd=PACKAGE_ROOT) + verbose_check_call('run_testserver', *statement.arg_list, cwd=PACKAGE_ROOT, timeout=None) def do_makemessages(self, statement: cmd2.Statement): """ @@ -226,6 +226,7 @@ class PyInventoryCommandSet(DevShellBaseCommandSet): extra_env={ 'PWDEBUG': '1', }, + timeout=None, ) def do_seed_data(self, statement: cmd2.Statement): diff --git a/src/inventory_project/tests/test_admin_item_auto_group_items_1.snapshot.html b/src/inventory_project/tests/test_admin_item_auto_group_items_1.snapshot.html index c135a85..238a8eb 100644 --- a/src/inventory_project/tests/test_admin_item_auto_group_items_1.snapshot.html +++ b/src/inventory_project/tests/test_admin_item_auto_group_items_1.snapshot.html @@ -4,16 +4,6 @@
    -
  • - - Import - -
  • -
  • - - Export - -
  • Recover deleted Items @@ -69,6 +59,8 @@ + + @@ -89,7 +81,7 @@
    - +
    @@ -98,6 +90,15 @@
    +
    +
    + + + @@ -124,7 +125,7 @@ @@ -133,7 +134,7 @@ @@ -142,7 +143,7 @@ @@ -156,13 +157,19 @@ - - - - main item 1 - - + +
    +
    + + + + + main item 1 + + + + @@ -181,14 +188,20 @@ - - - main item 1 › - - sub item 1.1 - - + +
    +
    + + + + main item 1 › + + sub item 1.1 + + + + @@ -207,14 +220,20 @@ - - - main item 1 › - - sub item 1.2 - - + +
    +
    + + + + main item 1 › + + sub item 1.2 + + + + @@ -233,13 +252,19 @@ - - - - main item 2 - - + +
    +
    + + + + + main item 2 + + + + @@ -258,14 +283,20 @@ - - - main item 2 › - - sub item 2.1 - - + +
    +
    + + + + main item 2 › + + sub item 2.1 + + + + @@ -284,14 +315,20 @@ - - - main item 2 › - - sub item 2.2 - - + +
    +
    + + + + main item 2 › + + sub item 2.2 + + + + diff --git a/src/inventory_project/tests/test_admin_item_normal_user_create_minimal_item_1.snapshot.html b/src/inventory_project/tests/test_admin_item_normal_user_create_minimal_item_1.snapshot.html index de29482..661be97 100644 --- a/src/inventory_project/tests/test_admin_item_normal_user_create_minimal_item_1.snapshot.html +++ b/src/inventory_project/tests/test_admin_item_normal_user_create_minimal_item_1.snapshot.html @@ -156,7 +156,7 @@ Parent: -
    +