From e04bea675b7491504c9d42e6ce0dd33cbfa7fd11 Mon Sep 17 00:00:00 2001 From: Bryant Finney Date: Mon, 29 Nov 2021 06:33:43 -0500 Subject: [PATCH] [#34] Relax black version requirements (PR #88) * move `black` and `autopep8` from `install_requires` to `extras_require` * add `usage` workflow to test installation of `pipenv-setup`, `pipenv-setup[black]`, and `pipenv-setup[autopep8]` * update behavior: if `black` is present, use it to format `setup.py`; if `black` isn't installed, try `autopep8`; if neither is installed, don't format `setup.py` --- .github/workflows/ci.yml | 1 + .github/workflows/usage.yml | 89 +++++++ Pipfile | 3 +- Pipfile.lock | 453 +++++++++++++--------------------- pipenv_setup/setup_updater.py | 71 ++++-- setup.py | 9 +- tests/setup_updater_test.py | 130 +++++++++- 7 files changed, 454 insertions(+), 302 deletions(-) create mode 100644 .github/workflows/usage.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 938590b..60c2590 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: name: test-${{ matrix.os }}-python${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: # this works like a loop; think `pytest.mark.parametrize` python-version: [2.7, 3.5, 3.6, 3.7, 3.8] diff --git a/.github/workflows/usage.yml b/.github/workflows/usage.yml new file mode 100644 index 0000000..5af8e82 --- /dev/null +++ b/.github/workflows/usage.yml @@ -0,0 +1,89 @@ +# ------------------------------------------------------------------------------------- +# Summary: Test the external CLI usage of this project. +# Created: 2021-11-20 18:44:48 +# Author: Bryant Finney (https://bryant-finney.github.io/about) +# ------------------------------------------------------------------------------------- +name: Test Usage + +on: + push: + pull_request: + workflow_dispatch: + release: + types: [published] + +jobs: + build: + name: Build wheel + outputs: + wheel: ${{ steps.build.outputs.wheel }} + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + + - name: Prepare build system + run: pip install --upgrade pip setuptools wheel + + - name: Build wheel and source distribution 🛠️ + id: build + run: | + python setup.py sdist bdist_wheel + echo "::set-output name=wheel::$(ls ./dist/*.whl)" + + - name: Upload build artifacts ⬆️ + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist/*.whl + + test-install: + name: "${{ matrix.os }} | py${{ matrix.py }}: ${{ matrix.manager }} install ${{ needs.build.outputs.wheel }}[${{ matrix.extras }}]" + needs: build + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + extras: ["", "dev", "black", "autopep8"] + manager: [pip, pipenv] + os: [ubuntu-latest, windows-latest, macos-latest] + py: [3.7, 3.8] + + steps: + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.py }} + + - name: Update ${{ matrix.manager }} + run: echo "${{ matrix.manager }}" | grep pipenv | xargs pip install --upgrade pip + + - name: Download build artifacts ⬇️ + uses: actions/download-artifact@v2 + with: + name: dist + path: dist + + - name: Install using ${{ matrix.manager }} ➕ + if: "!${{ matrix.extras }}" + run: ${{ matrix.manager }} install "${{ needs.build.outputs.wheel }}" + + - name: Install (with [${{ matrix.extras }}] extras) using ${{ matrix.manager }} ➕ + if: ${{ matrix.extras }} + run: ${{ matrix.manager }} install "${{ needs.build.outputs.wheel }}[${{ matrix.extras }}]" + + - name: "Verify ${{ matrix.extras }} installation (${{ matrix.manager }}) 🖨️" + if: ${{ matrix.manager == 'pip' && matrix.extras && matrix.extras != 'dev' }} + run: ${{ matrix.extras }} --version + + - name: "Verify ${{ matrix.extras }} installation (${{ matrix.manager }}) 🖨️" + if: ${{ matrix.manager == 'pipenv' && matrix.extras && matrix.extras != 'dev' }} + run: pipenv run ${{ matrix.extras }} --version + + - name: "Verify package installation (${{ matrix.manager }}) 🖨️" + if: ${{ matrix.manager == 'pip' }} + run: pipenv-setup --help + + - name: "Verify installation (${{ matrix.manager }}) 🖨️" + if: ${{ matrix.manager == 'pipenv' }} + run: pipenv run pipenv-setup --help diff --git a/Pipfile b/Pipfile index 1b2283d..0d3674e 100644 --- a/Pipfile +++ b/Pipfile @@ -4,6 +4,7 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] +black = { markers = "python_version>='3.6'", version = "==19.10b0" } pipenv-setup = { editable = true, path = "." } pytest = { markers = "python_version>='3.6'", version = "~=5.2" } pytest-mypy = { markers = "python_version>='3.5'", version = ">=0.8" } @@ -16,12 +17,10 @@ types-six = "*" [packages] pipfile = "~=0.0" -black = { markers = "python_version>='3.6'", version = "==19.10b0" } colorama = "~=0.4" packaging = "~=20.0" requirementslib = "~=1.5" vistir = "~=0.4" -autopep8 = { markers = "python_version<'3.6'", version = "~=1.4" } six = "~=1.12" typing = { markers = "python_version<'3.7'", version = "~=3.7" } chardet = ">=3.0.0, <=5.0.0" diff --git a/Pipfile.lock b/Pipfile.lock index 7d4c4d2..f8214f0 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "00d003ec557a252d5f197da77ac8d245442a32eb9e77fba899c0cd11917dcb04" + "sha256": "de230533f6c4ab017e619dfa0a006128495561a7d52712690ff8d5f851d47035" }, "pipfile-spec": 6, "requires": {}, @@ -14,13 +14,6 @@ ] }, "default": { - "appdirs": { - "hashes": [ - "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", - "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128" - ], - "version": "==1.4.4" - }, "attrs": { "hashes": [ "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1", @@ -29,23 +22,6 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==21.2.0" }, - "autopep8": { - "hashes": [ - "sha256:44f0932855039d2c15c4510d6df665e4730f2b8582704fa48f9c55bd3e17d979", - "sha256:ed77137193bbac52d029a52c59bec1b0629b5a186c495f1eb21b126ac466083f" - ], - "markers": "python_version < '3.6'", - "version": "==1.6.0" - }, - "black": { - "hashes": [ - "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b", - "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539" - ], - "index": "pypi", - "markers": "python_version >= '3.6'", - "version": "==19.10b0" - }, "cached-property": { "hashes": [ "sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130", @@ -82,14 +58,6 @@ "markers": "python_version >= '3'", "version": "==2.0.7" }, - "click": { - "hashes": [ - "sha256:353f466495adaeb40b6b5f592f9f91cb22372351c84caeb068132442a4518ef3", - "sha256:410e932b050f5eed773c4cda94de75971c89cdb3155a72a0831139a79e5ecb5b" - ], - "markers": "python_version >= '3.6'", - "version": "==8.0.3" - }, "colorama": { "hashes": [ "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b", @@ -128,13 +96,6 @@ "index": "pypi", "version": "==20.9" }, - "pathspec": { - "hashes": [ - "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a", - "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1" - ], - "version": "==0.9.0" - }, "pep517": { "hashes": [ "sha256:931378d93d11b298cf511dd634cf5ea4cb249a28ef84160b3247ee9afb4e8ab0", @@ -142,6 +103,14 @@ ], "version": "==0.12.0" }, + "pip": { + "hashes": [ + "sha256:deaf32dcd9ab821e359cd8330786bcd077604b5c5730c0b096eda46f95c24a2d", + "sha256:fd11ba3d0fdb4c07fbc5ecbba0b1b719809420f25038f8ee3cd913d3faa3033a" + ], + "markers": "python_version >= '3.6'", + "version": "==21.3.1" + }, "pip-shims": { "hashes": [ "sha256:b6704551be47f9a7b05cbdb51a180b6d68be4c980c255e22d6a6dec7feb8f087", @@ -178,11 +147,11 @@ }, "pyparsing": { "hashes": [ - "sha256:c0a7dfcd26825bd4453574c4e7ad04aa095975ce54d04f738fe3a8350fbd223a", - "sha256:e0df773d7fa2240322daae7805626dfc5f2d5effb34e1a7be2702c99cfb9f6b1" + "sha256:04ff808a5b90911829c55c4e26f75fa5ca8a2f5f36aa3a51f68e27033341d3e4", + "sha256:d9bdec0013ef1eb5a84ab39a3b3868911598afa494f5faa038647101504e2b81" ], "index": "pypi", - "version": "==3.0.4" + "version": "==3.0.6" }, "python-dateutil": { "hashes": [ @@ -192,60 +161,6 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.8.2" }, - "regex": { - "hashes": [ - "sha256:0075fe4e2c2720a685fef0f863edd67740ff78c342cf20b2a79bc19388edf5db", - "sha256:0621c90f28d17260b41838b22c81a79ff436141b322960eb49c7b3f91d1cbab6", - "sha256:070336382ca92c16c45b4066c4ba9fa83fb0bd13d5553a82e07d344df8d58a84", - "sha256:075b0fdbaea81afcac5a39a0d1bb91de887dd0d93bf692a5dd69c430e7fc58cb", - "sha256:07e3755e0f070bc31567dfe447a02011bfa8444239b3e9e5cca6773a22133839", - "sha256:0ed3465acf8c7c10aa2e0f3d9671da410ead63b38a77283ef464cbb64275df58", - "sha256:17e095f7f96a4b9f24b93c2c915f31a5201a6316618d919b0593afb070a5270e", - "sha256:1d85ca137756d62c8138c971453cafe64741adad1f6a7e63a22a5a8abdbd19fa", - "sha256:20605bfad484e1341b2cbfea0708e4b211d233716604846baa54b94821f487cb", - "sha256:23f93e74409c210de4de270d4bf88fb8ab736a7400f74210df63a93728cf70d6", - "sha256:2bb7cae741de1aa03e3dd3a7d98c304871eb155921ca1f0d7cc11f5aade913fd", - "sha256:2e3ff69ab203b54ce5c480c3ccbe959394ea5beef6bd5ad1785457df7acea92e", - "sha256:30fe317332de0e50195665bc61a27d46e903d682f94042c36b3f88cb84bd7958", - "sha256:3576e173e7b4f88f683b4de7db0c2af1b209bb48b2bf1c827a6f3564fad59a97", - "sha256:35ed5714467fc606551db26f80ee5d6aa1f01185586a7bccd96f179c4b974a11", - "sha256:41c66bd6750237a8ed23028a6c9173dc0c92dc24c473e771d3bfb9ee817700c3", - "sha256:48b4f4810117a9072a5aa70f7fea5f86fa9efbe9a798312e0a05044bd707cc33", - "sha256:4abf35e16f4b639daaf05a2602c1b1d47370e01babf9821306aa138924e3fe92", - "sha256:4fba661a4966adbd2c3c08d3caad6822ecb6878f5456588e2475ae23a6e47929", - "sha256:5e85dcfc5d0f374955015ae12c08365b565c6f1eaf36dd182476a4d8e5a1cdb7", - "sha256:77f9d16f7970791f17ecce7e7f101548314ed1ee2583d4268601f30af3170856", - "sha256:7ee36d5113b6506b97f45f2e8447cb9af146e60e3f527d93013d19f6d0405f3b", - "sha256:7fab29411d75c2eb48070020a40f80255936d7c31357b086e5931c107d48306e", - "sha256:85289c25f658e3260b00178757c87f033f3d4b3e40aa4abdd4dc875ff11a94fb", - "sha256:886f459db10c0f9d17c87d6594e77be915f18d343ee138e68d259eb385f044a8", - "sha256:897c539f0f3b2c3a715be651322bef2167de1cdc276b3f370ae81a3bda62df71", - "sha256:8fbe1768feafd3d0156556677b8ff234c7bf94a8110e906b2d73506f577a3269", - "sha256:9267e4fba27e6dd1008c4f2983cc548c98b4be4444e3e342db11296c0f45512f", - "sha256:9486ebda015913909bc28763c6b92fcc3b5e5a67dee4674bceed112109f5dfb8", - "sha256:956187ff49db7014ceb31e88fcacf4cf63371e6e44d209cf8816cd4a2d61e11a", - "sha256:a56735c35a3704603d9d7b243ee06139f0837bcac2171d9ba1d638ce1df0742a", - "sha256:ab1fea8832976ad0bebb11f652b692c328043057d35e9ebc78ab0a7a30cf9a70", - "sha256:adf35d88d9cffc202e6046e4c32e1e11a1d0238b2fcf095c94f109e510ececea", - "sha256:af23b9ca9a874ef0ec20e44467b8edd556c37b0f46f93abfa93752ea7c0e8d1e", - "sha256:b3794cea825f101fe0df9af8a00f9fad8e119c91e39a28636b95ee2b45b6c2e5", - "sha256:bb11c982a849dc22782210b01d0c1b98eb3696ce655d58a54180774e4880ac66", - "sha256:be30cd315db0168063a1755fa20a31119da91afa51da2907553493516e165640", - "sha256:c6238d30dcff141de076344cf7f52468de61729c2f70d776fce12f55fe8df790", - "sha256:cb1e44d860345ab5d4f533b6c37565a22f403277f44c4d2d5e06c325da959883", - "sha256:d4bfe3bc3976ccaeb4ae32f51e631964e2f0e85b2b752721b7a02de5ce3b7f27", - "sha256:d8ee91e1c295beb5c132ebd78616814de26fedba6aa8687ea460c7f5eb289b72", - "sha256:e3c00cb5c71da655e1e5161481455479b613d500dd1bd252aa01df4f037c641f", - "sha256:e9cec3a62d146e8e122d159ab93ac32c988e2ec0dcb1e18e9e53ff2da4fbd30c", - "sha256:ef4e53e2fdc997d91f5b682f81f7dc9661db9a437acce28745d765d251902d85", - "sha256:f0148988af0182a0a4e5020e7c168014f2c55a16d11179610f7883dd48ac0ebe", - "sha256:f20f9f430c33597887ba9bd76635476928e76cad2981643ca8be277b8e97aa96", - "sha256:f5930d334c2f607711d54761956aedf8137f83f1b764b9640be21d25a976f3a4", - "sha256:f6a28e87ba69f3a4f30d775b179aac55be1ce59f55799328a0d9b6df8f16b39d", - "sha256:f9ee98d658a146cb6507be720a0ce1b44f2abef8fb43c2859791d91aace17cd5" - ], - "version": "==2021.11.2" - }, "requests": { "hashes": [ "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24", @@ -262,6 +177,14 @@ "index": "pypi", "version": "==1.6.1" }, + "setuptools": { + "hashes": [ + "sha256:157d21de9d055ab9e8ea3186d91e7f4f865e11f42deafa952d90842671fc2576", + "sha256:4adde3d1e1c89bde1c643c64d89cdd94cbfd8c75252ee459d4500bccb9c7d05d" + ], + "markers": "python_version >= '3.6'", + "version": "==59.2.0" + }, "six": { "hashes": [ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", @@ -294,41 +217,6 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==0.7.2" }, - "typed-ast": { - "hashes": [ - "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060be5dad2c730ace", - "sha256:067a74454df670dcaa4e59349a2e5c81e567d8d65458d480a5b3dfecec08c5ff", - "sha256:0fb71b8c643187d7492c1f8352f2c15b4c4af3f6338f21681d3681b3dc31a266", - "sha256:1b3ead4a96c9101bef08f9f7d1217c096f31667617b58de957f690c92378b528", - "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6", - "sha256:209596a4ec71d990d71d5e0d312ac935d86930e6eecff6ccc7007fe54d703808", - "sha256:2c726c276d09fc5c414693a2de063f521052d9ea7c240ce553316f70656c84d4", - "sha256:398e44cd480f4d2b7ee8d98385ca104e35c81525dd98c519acff1b79bdaac363", - "sha256:52b1eb8c83f178ab787f3a4283f68258525f8d70f778a2f6dd54d3b5e5fb4341", - "sha256:5feca99c17af94057417d744607b82dd0a664fd5e4ca98061480fd8b14b18d04", - "sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088a1636180f11a41", - "sha256:760ad187b1041a154f0e4d0f6aae3e40fdb51d6de16e5c99aedadd9246450e9e", - "sha256:777a26c84bea6cd934422ac2e3b78863a37017618b6e5c08f92ef69853e765d3", - "sha256:95431a26309a21874005845c21118c83991c63ea800dd44843e42a916aec5899", - "sha256:9ad2c92ec681e02baf81fdfa056fe0d818645efa9af1f1cd5fd6f1bd2bdfd805", - "sha256:9c6d1a54552b5330bc657b7ef0eae25d00ba7ffe85d9ea8ae6540d2197a3788c", - "sha256:aee0c1256be6c07bd3e1263ff920c325b59849dc95392a05f258bb9b259cf39c", - "sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f22ee626a7b88e39", - "sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb608a65c3a49e1a", - "sha256:b9574c6f03f685070d859e75c7f9eeca02d6933273b5e69572e5ff9d5e3931c3", - "sha256:bff6ad71c81b3bba8fa35f0f1921fb24ff4476235a6e94a26ada2e54370e6da7", - "sha256:c190f0899e9f9f8b6b7863debfb739abcb21a5c054f911ca3596d12b8a4c4c7f", - "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708bffe863cbe4075", - "sha256:cae53c389825d3b46fb37538441f75d6aecc4174f615d048321b716df2757fb0", - "sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063ad102fe9c425e40", - "sha256:dde816ca9dac1d9c01dd504ea5967821606f02e510438120091b84e852367428", - "sha256:f2362f3cb0f3172c42938946dbc5b7843c2a28aec307c49100c8b38764eb6927", - "sha256:f328adcfebed9f11301eaedfa48e15bdece9b519fb27e6a8c01aa52a17ec31b3", - "sha256:f8afcf15cc511ada719a88e013cec87c11aff7b91f019295eb4530f96fe5ef2f", - "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65" - ], - "version": "==1.4.3" - }, "typing": { "hashes": [ "sha256:1187fb9c82fd670d10aa07bbb6cfcfe4bdda42d6fab8d5134f04e8c4d0b71cc9", @@ -383,16 +271,16 @@ "sha256:44f0932855039d2c15c4510d6df665e4730f2b8582704fa48f9c55bd3e17d979", "sha256:ed77137193bbac52d029a52c59bec1b0629b5a186c495f1eb21b126ac466083f" ], - "markers": "python_version < '3.6'", + "index": "pypi", "version": "==1.6.0" }, "backports.entry-points-selectable": { "hashes": [ - "sha256:988468260ec1c196dab6ae1149260e2f5472c9110334e5d51adcb77867361f6a", - "sha256:a6d9a871cde5e15b4c4a53e3d43ba890cc6861ec1332c9c2428c92f977192acc" + "sha256:7fceed9532a7aa2bd888654a7314f864a3c16a4e710b34a58cfc0f08114c663b", + "sha256:914b21a479fde881635f7af5adc7f6e38d6b274be32269070c53b698c60d5386" ], "markers": "python_version >= '2.7'", - "version": "==1.1.0" + "version": "==1.1.1" }, "black": { "hashes": [ @@ -457,55 +345,56 @@ }, "coverage": { "hashes": [ - "sha256:0147f7833c41927d84f5af9219d9b32f875c0689e5e74ac8ca3cb61e73a698f9", - "sha256:04a92a6cf9afd99f9979c61348ec79725a9f9342fb45e63c889e33c04610d97b", - "sha256:10ab138b153e4cc408b43792cb7f518f9ee02f4ff55cd1ab67ad6fd7e9905c7e", - "sha256:2e5b9c17a56b8bf0c0a9477fcd30d357deb486e4e1b389ed154f608f18556c8a", - "sha256:326d944aad0189603733d646e8d4a7d952f7145684da973c463ec2eefe1387c2", - "sha256:359a32515e94e398a5c0fa057e5887a42e647a9502d8e41165cf5cb8d3d1ca67", - "sha256:35cd2230e1ed76df7d0081a997f0fe705be1f7d8696264eb508076e0d0b5a685", - "sha256:3b270c6b48d3ff5a35deb3648028ba2643ad8434b07836782b1139cf9c66313f", - "sha256:42a1fb5dee3355df90b635906bb99126faa7936d87dfc97eacc5293397618cb7", - "sha256:479228e1b798d3c246ac89b09897ee706c51b3e5f8f8d778067f38db73ccc717", - "sha256:4cd919057636f63ab299ccb86ea0e78b87812400c76abab245ca385f17d19fb5", - "sha256:4d8b453764b9b26b0dd2afb83086a7c3f9379134e340288d2a52f8a91592394b", - "sha256:51a441011a30d693e71dea198b2a6f53ba029afc39f8e2aeb5b77245c1b282ef", - "sha256:557594a50bfe3fb0b1b57460f6789affe8850ad19c1acf2d14a3e12b2757d489", - "sha256:572f917267f363101eec375c109c9c1118037c7cc98041440b5eabda3185ac7b", - "sha256:62512c0ec5d307f56d86504c58eace11c1bc2afcdf44e3ff20de8ca427ca1d0e", - "sha256:65ad3ff837c89a229d626b8004f0ee32110f9bfdb6a88b76a80df36ccc60d926", - "sha256:666c6b32b69e56221ad1551d377f718ed00e6167c7a1b9257f780b105a101271", - "sha256:6e994003e719458420e14ffb43c08f4c14990e20d9e077cb5cad7a3e419bbb54", - "sha256:72bf437d54186d104388cbae73c9f2b0f8a3e11b6e8d7deb593bd14625c96026", - "sha256:738e823a746841248b56f0f3bd6abf3b73af191d1fd65e4c723b9c456216f0ad", - "sha256:78287731e3601ea5ce9d6468c82d88a12ef8fe625d6b7bdec9b45d96c1ad6533", - "sha256:7833c872718dc913f18e51ee97ea0dece61d9930893a58b20b3daf09bb1af6b6", - "sha256:7e083d32965d2eb6638a77e65b622be32a094fdc0250f28ce6039b0732fbcaa8", - "sha256:8186b5a4730c896cbe1e4b645bdc524e62d874351ae50e1db7c3e9f5dc81dc26", - "sha256:8605add58e6a960729aa40c0fd9a20a55909dd9b586d3e8104cc7f45869e4c6b", - "sha256:977ce557d79577a3dd510844904d5d968bfef9489f512be65e2882e1c6eed7d8", - "sha256:994ce5a7b3d20981b81d83618aa4882f955bfa573efdbef033d5632b58597ba9", - "sha256:9ad5895938a894c368d49d8470fe9f519909e5ebc6b8f8ea5190bd0df6aa4271", - "sha256:9eb0a1923354e0fdd1c8a6f53f5db2e6180d670e2b587914bf2e79fa8acfd003", - "sha256:a00284dbfb53b42e35c7dd99fc0e26ef89b4a34efff68078ed29d03ccb28402a", - "sha256:a11a2c019324fc111485e79d55907e7289e53d0031275a6c8daed30690bc50c0", - "sha256:ab6a0fe4c96f8058d41948ddf134420d3ef8c42d5508b5a341a440cce7a37a1d", - "sha256:b1d0a1bce919de0dd8da5cff4e616b2d9e6ebf3bd1410ff645318c3dd615010a", - "sha256:b8e4f15b672c9156c1154249a9c5746e86ac9ae9edc3799ee3afebc323d9d9e0", - "sha256:bbca34dca5a2d60f81326d908d77313816fad23d11b6069031a3d6b8c97a54f9", - "sha256:bf656cd74ff7b4ed7006cdb2a6728150aaad69c7242b42a2a532f77b63ea233f", - "sha256:c95257aa2ccf75d3d91d772060538d5fea7f625e48157f8ca44594f94d41cb33", - "sha256:dc5023be1c2a8b0a0ab5e31389e62c28b2453eb31dd069f4b8d1a0f9814d951a", - "sha256:e14bceb1f3ae8a14374be2b2d7bc12a59226872285f91d66d301e5f41705d4d6", - "sha256:e3c4f5211394cd0bf6874ac5d29684a495f9c374919833dcfff0bd6d37f96201", - "sha256:e76f017b6d4140a038c5ff12be1581183d7874e41f1c0af58ecf07748d36a336", - "sha256:e7d5606b9240ed4def9cbdf35be4308047d11e858b9c88a6c26974758d6225ce", - "sha256:f0f80e323a17af63eac6a9db0c9188c10f1fd815c3ab299727150cc0eb92c7a4", - "sha256:fb2fa2f6506c03c48ca42e3fe5a692d7470d290c047ee6de7c0f3e5fa7639ac9", - "sha256:ffa8fee2b1b9e60b531c4c27cf528d6b5d5da46b1730db1f4d6eee56ff282e07" + "sha256:046647b96969fda1ae0605f61288635209dd69dcd27ba3ec0bf5148bc157f954", + "sha256:06d009e8a29483cbc0520665bc46035ffe9ae0e7484a49f9782c2a716e37d0a0", + "sha256:0cde7d9fe2fb55ff68ebe7fb319ef188e9b88e0a3d1c9c5db7dd829cd93d2193", + "sha256:1de9c6f5039ee2b1860b7bad2c7bc3651fbeb9368e4c4d93e98a76358cdcb052", + "sha256:24ed38ec86754c4d5a706fbd5b52b057c3df87901a8610d7e5642a08ec07087e", + "sha256:27a3df08a855522dfef8b8635f58bab81341b2fb5f447819bc252da3aa4cf44c", + "sha256:310c40bed6b626fd1f463e5a83dba19a61c4eb74e1ac0d07d454ebbdf9047e9d", + "sha256:3348865798c077c695cae00da0924136bb5cc501f236cfd6b6d9f7a3c94e0ec4", + "sha256:35b246ae3a2c042dc8f410c94bcb9754b18179cdb81ff9477a9089dbc9ecc186", + "sha256:3f546f48d5d80a90a266769aa613bc0719cb3e9c2ef3529d53f463996dd15a9d", + "sha256:586d38dfc7da4a87f5816b203ff06dd7c1bb5b16211ccaa0e9788a8da2b93696", + "sha256:5d3855d5d26292539861f5ced2ed042fc2aa33a12f80e487053aed3bcb6ced13", + "sha256:610c0ba11da8de3a753dc4b1f71894f9f9debfdde6559599f303286e70aeb0c2", + "sha256:62646d98cf0381ffda301a816d6ac6c35fc97aa81b09c4c52d66a15c4bef9d7c", + "sha256:66af99c7f7b64d050d37e795baadf515b4561124f25aae6e1baa482438ecc388", + "sha256:675adb3b3380967806b3cbb9c5b00ceb29b1c472692100a338730c1d3e59c8b9", + "sha256:6e5a8c947a2a89c56655ecbb789458a3a8e3b0cbf4c04250331df8f647b3de59", + "sha256:7a39590d1e6acf6a3c435c5d233f72f5d43b585f5be834cff1f21fec4afda225", + "sha256:80cb70264e9a1d04b519cdba3cd0dc42847bf8e982a4d55c769b9b0ee7cdce1e", + "sha256:82fdcb64bf08aa5db881db061d96db102c77397a570fbc112e21c48a4d9cb31b", + "sha256:8492d37acdc07a6eac6489f6c1954026f2260a85a4c2bb1e343fe3d35f5ee21a", + "sha256:94f558f8555e79c48c422045f252ef41eb43becdd945e9c775b45ebfc0cbd78f", + "sha256:958ac66272ff20e63d818627216e3d7412fdf68a2d25787b89a5c6f1eb7fdd93", + "sha256:95a58336aa111af54baa451c33266a8774780242cab3704b7698d5e514840758", + "sha256:96129e41405887a53a9cc564f960d7f853cc63d178f3a182fdd302e4cab2745b", + "sha256:97ef6e9119bd39d60ef7b9cd5deea2b34869c9f0b9777450a7e3759c1ab09b9b", + "sha256:98d44a8136eebbf544ad91fef5bd2b20ef0c9b459c65a833c923d9aa4546b204", + "sha256:9d2c2e3ce7b8cc932a2f918186964bd44de8c84e2f9ef72dc616f5bb8be22e71", + "sha256:a300b39c3d5905686c75a369d2a66e68fd01472ea42e16b38c948bd02b29e5bd", + "sha256:a34fccb45f7b2d890183a263578d60a392a1a218fdc12f5bce1477a6a68d4373", + "sha256:a4d48e42e17d3de212f9af44f81ab73b9378a4b2b8413fd708d0d9023f2bbde4", + "sha256:af45eea024c0e3a25462fade161afab4f0d9d9e0d5a5d53e86149f74f0a35ecc", + "sha256:ba6125d4e55c0b8e913dad27b22722eac7abdcb1f3eab1bd090eee9105660266", + "sha256:bc1ee1318f703bc6c971da700d74466e9b86e0c443eb85983fb2a1bd20447263", + "sha256:c18725f3cffe96732ef96f3de1939d81215fd6d7d64900dcc4acfe514ea4fcbf", + "sha256:c8e9c4bcaaaa932be581b3d8b88b677489975f845f7714efc8cce77568b6711c", + "sha256:cc799916b618ec9fd00135e576424165691fec4f70d7dc12cfaef09268a2478c", + "sha256:cd2d11a59afa5001ff28073ceca24ae4c506da4355aba30d1e7dd2bd0d2206dc", + "sha256:d0a595a781f8e186580ff8e3352dd4953b1944289bec7705377c80c7e36c4d6c", + "sha256:d3c5f49ce6af61154060640ad3b3281dbc46e2e0ef2fe78414d7f8a324f0b649", + "sha256:d9a635114b88c0ab462e0355472d00a180a5fbfd8511e7f18e4ac32652e7d972", + "sha256:e5432d9c329b11c27be45ee5f62cf20a33065d482c8dec1941d6670622a6fb8f", + "sha256:eab14fdd410500dae50fd14ccc332e65543e7b39f6fc076fe90603a0e5d2f929", + "sha256:ebcc03e1acef4ff44f37f3c61df478d6e469a573aa688e5a162f85d7e4c3860d", + "sha256:fae3fe111670e51f1ebbc475823899524e3459ea2db2cb88279bbfb2a0b8a3de", + "sha256:fd92ece726055e80d4e3f01fff3b91f54b18c9c357c48fcf6119e87e2461a091", + "sha256:ffa545230ca2ad921ad066bf8fd627e7be43716b6e0fcf8e32af1b8188ccb0ab" ], "markers": "python_version >= '3.6'", - "version": "==6.1.1" + "version": "==6.1.2" }, "distlib": { "hashes": [ @@ -524,11 +413,11 @@ }, "filelock": { "hashes": [ - "sha256:7afc856f74fa7006a289fd10fa840e1eebd8bbff6bffb69c26c54a0512ea8cf8", - "sha256:bb2a1c717df74c48a2d00ed625e5a66f8572a3a30baacb7657add1d7bac4097b" + "sha256:2e139a228bcf56dd8b2274a65174d005c4a6b68540ee0bdbb92c76f43f29f7e8", + "sha256:93d512b32a23baf4cac44ffd72ccf70732aeff7b8050fcaf6d3ec406d954baf4" ], "markers": "python_version >= '3.6'", - "version": "==3.3.2" + "version": "==3.4.0" }, "idna": { "hashes": [ @@ -540,11 +429,11 @@ }, "more-itertools": { "hashes": [ - "sha256:1debcabeb1df793814859d64a81ad7cb10504c24349368ccf214c664c474f41f", - "sha256:56ddac45541718ba332db05f464bebfb0768110111affd27f66e0051f276fa43" + "sha256:0a2fd25d343c08d7e7212071820e7e7ea2f41d8fb45d6bc8a00cd6ce3b7aab88", + "sha256:88afff98d83d08fe5e4049b81e2b54c06ebb6b3871a600040865c7a592061cbb" ], "markers": "python_version >= '3.5'", - "version": "==8.10.0" + "version": "==8.11.0" }, "mypy": { "hashes": [ @@ -611,6 +500,14 @@ ], "version": "==0.12.0" }, + "pip": { + "hashes": [ + "sha256:deaf32dcd9ab821e359cd8330786bcd077604b5c5730c0b096eda46f95c24a2d", + "sha256:fd11ba3d0fdb4c07fbc5ecbba0b1b719809420f25038f8ee3cd913d3faa3033a" + ], + "markers": "python_version >= '3.6'", + "version": "==21.3.1" + }, "pip-shims": { "hashes": [ "sha256:b6704551be47f9a7b05cbdb51a180b6d68be4c980c255e22d6a6dec7feb8f087", @@ -675,11 +572,11 @@ }, "pyparsing": { "hashes": [ - "sha256:c0a7dfcd26825bd4453574c4e7ad04aa095975ce54d04f738fe3a8350fbd223a", - "sha256:e0df773d7fa2240322daae7805626dfc5f2d5effb34e1a7be2702c99cfb9f6b1" + "sha256:04ff808a5b90911829c55c4e26f75fa5ca8a2f5f36aa3a51f68e27033341d3e4", + "sha256:d9bdec0013ef1eb5a84ab39a3b3868911598afa494f5faa038647101504e2b81" ], "index": "pypi", - "version": "==3.0.4" + "version": "==3.0.6" }, "pytest": { "hashes": [ @@ -741,57 +638,57 @@ }, "regex": { "hashes": [ - "sha256:0075fe4e2c2720a685fef0f863edd67740ff78c342cf20b2a79bc19388edf5db", - "sha256:0621c90f28d17260b41838b22c81a79ff436141b322960eb49c7b3f91d1cbab6", - "sha256:070336382ca92c16c45b4066c4ba9fa83fb0bd13d5553a82e07d344df8d58a84", - "sha256:075b0fdbaea81afcac5a39a0d1bb91de887dd0d93bf692a5dd69c430e7fc58cb", - "sha256:07e3755e0f070bc31567dfe447a02011bfa8444239b3e9e5cca6773a22133839", - "sha256:0ed3465acf8c7c10aa2e0f3d9671da410ead63b38a77283ef464cbb64275df58", - "sha256:17e095f7f96a4b9f24b93c2c915f31a5201a6316618d919b0593afb070a5270e", - "sha256:1d85ca137756d62c8138c971453cafe64741adad1f6a7e63a22a5a8abdbd19fa", - "sha256:20605bfad484e1341b2cbfea0708e4b211d233716604846baa54b94821f487cb", - "sha256:23f93e74409c210de4de270d4bf88fb8ab736a7400f74210df63a93728cf70d6", - "sha256:2bb7cae741de1aa03e3dd3a7d98c304871eb155921ca1f0d7cc11f5aade913fd", - "sha256:2e3ff69ab203b54ce5c480c3ccbe959394ea5beef6bd5ad1785457df7acea92e", - "sha256:30fe317332de0e50195665bc61a27d46e903d682f94042c36b3f88cb84bd7958", - "sha256:3576e173e7b4f88f683b4de7db0c2af1b209bb48b2bf1c827a6f3564fad59a97", - "sha256:35ed5714467fc606551db26f80ee5d6aa1f01185586a7bccd96f179c4b974a11", - "sha256:41c66bd6750237a8ed23028a6c9173dc0c92dc24c473e771d3bfb9ee817700c3", - "sha256:48b4f4810117a9072a5aa70f7fea5f86fa9efbe9a798312e0a05044bd707cc33", - "sha256:4abf35e16f4b639daaf05a2602c1b1d47370e01babf9821306aa138924e3fe92", - "sha256:4fba661a4966adbd2c3c08d3caad6822ecb6878f5456588e2475ae23a6e47929", - "sha256:5e85dcfc5d0f374955015ae12c08365b565c6f1eaf36dd182476a4d8e5a1cdb7", - "sha256:77f9d16f7970791f17ecce7e7f101548314ed1ee2583d4268601f30af3170856", - "sha256:7ee36d5113b6506b97f45f2e8447cb9af146e60e3f527d93013d19f6d0405f3b", - "sha256:7fab29411d75c2eb48070020a40f80255936d7c31357b086e5931c107d48306e", - "sha256:85289c25f658e3260b00178757c87f033f3d4b3e40aa4abdd4dc875ff11a94fb", - "sha256:886f459db10c0f9d17c87d6594e77be915f18d343ee138e68d259eb385f044a8", - "sha256:897c539f0f3b2c3a715be651322bef2167de1cdc276b3f370ae81a3bda62df71", - "sha256:8fbe1768feafd3d0156556677b8ff234c7bf94a8110e906b2d73506f577a3269", - "sha256:9267e4fba27e6dd1008c4f2983cc548c98b4be4444e3e342db11296c0f45512f", - "sha256:9486ebda015913909bc28763c6b92fcc3b5e5a67dee4674bceed112109f5dfb8", - "sha256:956187ff49db7014ceb31e88fcacf4cf63371e6e44d209cf8816cd4a2d61e11a", - "sha256:a56735c35a3704603d9d7b243ee06139f0837bcac2171d9ba1d638ce1df0742a", - "sha256:ab1fea8832976ad0bebb11f652b692c328043057d35e9ebc78ab0a7a30cf9a70", - "sha256:adf35d88d9cffc202e6046e4c32e1e11a1d0238b2fcf095c94f109e510ececea", - "sha256:af23b9ca9a874ef0ec20e44467b8edd556c37b0f46f93abfa93752ea7c0e8d1e", - "sha256:b3794cea825f101fe0df9af8a00f9fad8e119c91e39a28636b95ee2b45b6c2e5", - "sha256:bb11c982a849dc22782210b01d0c1b98eb3696ce655d58a54180774e4880ac66", - "sha256:be30cd315db0168063a1755fa20a31119da91afa51da2907553493516e165640", - "sha256:c6238d30dcff141de076344cf7f52468de61729c2f70d776fce12f55fe8df790", - "sha256:cb1e44d860345ab5d4f533b6c37565a22f403277f44c4d2d5e06c325da959883", - "sha256:d4bfe3bc3976ccaeb4ae32f51e631964e2f0e85b2b752721b7a02de5ce3b7f27", - "sha256:d8ee91e1c295beb5c132ebd78616814de26fedba6aa8687ea460c7f5eb289b72", - "sha256:e3c00cb5c71da655e1e5161481455479b613d500dd1bd252aa01df4f037c641f", - "sha256:e9cec3a62d146e8e122d159ab93ac32c988e2ec0dcb1e18e9e53ff2da4fbd30c", - "sha256:ef4e53e2fdc997d91f5b682f81f7dc9661db9a437acce28745d765d251902d85", - "sha256:f0148988af0182a0a4e5020e7c168014f2c55a16d11179610f7883dd48ac0ebe", - "sha256:f20f9f430c33597887ba9bd76635476928e76cad2981643ca8be277b8e97aa96", - "sha256:f5930d334c2f607711d54761956aedf8137f83f1b764b9640be21d25a976f3a4", - "sha256:f6a28e87ba69f3a4f30d775b179aac55be1ce59f55799328a0d9b6df8f16b39d", - "sha256:f9ee98d658a146cb6507be720a0ce1b44f2abef8fb43c2859791d91aace17cd5" - ], - "version": "==2021.11.2" + "sha256:05b7d6d7e64efe309972adab77fc2af8907bb93217ec60aa9fe12a0dad35874f", + "sha256:0617383e2fe465732af4509e61648b77cbe3aee68b6ac8c0b6fe934db90be5cc", + "sha256:07856afef5ffcc052e7eccf3213317fbb94e4a5cd8177a2caa69c980657b3cb4", + "sha256:162abfd74e88001d20cb73ceaffbfe601469923e875caf9118333b1a4aaafdc4", + "sha256:2207ae4f64ad3af399e2d30dde66f0b36ae5c3129b52885f1bffc2f05ec505c8", + "sha256:30ab804ea73972049b7a2a5c62d97687d69b5a60a67adca07eb73a0ddbc9e29f", + "sha256:3b5df18db1fccd66de15aa59c41e4f853b5df7550723d26aa6cb7f40e5d9da5a", + "sha256:3c5fb32cc6077abad3bbf0323067636d93307c9fa93e072771cf9a64d1c0f3ef", + "sha256:416c5f1a188c91e3eb41e9c8787288e707f7d2ebe66e0a6563af280d9b68478f", + "sha256:432bd15d40ed835a51617521d60d0125867f7b88acf653e4ed994a1f8e4995dc", + "sha256:4aaa4e0705ef2b73dd8e36eeb4c868f80f8393f5f4d855e94025ce7ad8525f50", + "sha256:537ca6a3586931b16a85ac38c08cc48f10fc870a5b25e51794c74df843e9966d", + "sha256:53db2c6be8a2710b359bfd3d3aa17ba38f8aa72a82309a12ae99d3c0c3dcd74d", + "sha256:5537f71b6d646f7f5f340562ec4c77b6e1c915f8baae822ea0b7e46c1f09b733", + "sha256:6650f16365f1924d6014d2ea770bde8555b4a39dc9576abb95e3cd1ff0263b36", + "sha256:666abff54e474d28ff42756d94544cdfd42e2ee97065857413b72e8a2d6a6345", + "sha256:68a067c11463de2a37157930d8b153005085e42bcb7ad9ca562d77ba7d1404e0", + "sha256:780b48456a0f0ba4d390e8b5f7c661fdd218934388cde1a974010a965e200e12", + "sha256:788aef3549f1924d5c38263104dae7395bf020a42776d5ec5ea2b0d3d85d6646", + "sha256:7ee1227cf08b6716c85504aebc49ac827eb88fcc6e51564f010f11a406c0a667", + "sha256:7f301b11b9d214f83ddaf689181051e7f48905568b0c7017c04c06dfd065e244", + "sha256:83ee89483672b11f8952b158640d0c0ff02dc43d9cb1b70c1564b49abe92ce29", + "sha256:85bfa6a5413be0ee6c5c4a663668a2cad2cbecdee367630d097d7823041bdeec", + "sha256:9345b6f7ee578bad8e475129ed40123d265464c4cfead6c261fd60fc9de00bcf", + "sha256:93a5051fcf5fad72de73b96f07d30bc29665697fb8ecdfbc474f3452c78adcf4", + "sha256:962b9a917dd7ceacbe5cd424556914cb0d636001e393b43dc886ba31d2a1e449", + "sha256:98ba568e8ae26beb726aeea2273053c717641933836568c2a0278a84987b2a1a", + "sha256:a3feefd5e95871872673b08636f96b61ebef62971eab044f5124fb4dea39919d", + "sha256:b43c2b8a330a490daaef5a47ab114935002b13b3f9dc5da56d5322ff218eeadb", + "sha256:b483c9d00a565633c87abd0aaf27eb5016de23fed952e054ecc19ce32f6a9e7e", + "sha256:ba05430e819e58544e840a68b03b28b6d328aff2e41579037e8bab7653b37d83", + "sha256:ca5f18a75e1256ce07494e245cdb146f5a9267d3c702ebf9b65c7f8bd843431e", + "sha256:d5ca078bb666c4a9d1287a379fe617a6dccd18c3e8a7e6c7e1eb8974330c626a", + "sha256:da1a90c1ddb7531b1d5ff1e171b4ee61f6345119be7351104b67ff413843fe94", + "sha256:dba70f30fd81f8ce6d32ddeef37d91c8948e5d5a4c63242d16a2b2df8143aafc", + "sha256:dd33eb9bdcfbabab3459c9ee651d94c842bc8a05fabc95edf4ee0c15a072495e", + "sha256:e0538c43565ee6e703d3a7c3bdfe4037a5209250e8502c98f20fea6f5fdf2965", + "sha256:e1f54b9b4b6c53369f40028d2dd07a8c374583417ee6ec0ea304e710a20f80a0", + "sha256:e32d2a2b02ccbef10145df9135751abea1f9f076e67a4e261b05f24b94219e36", + "sha256:e71255ba42567d34a13c03968736c5d39bb4a97ce98188fafb27ce981115beec", + "sha256:ed2e07c6a26ed4bea91b897ee2b0835c21716d9a469a96c3e878dc5f8c55bb23", + "sha256:eef2afb0fd1747f33f1ee3e209bce1ed582d1896b240ccc5e2697e3275f037c7", + "sha256:f23222527b307970e383433daec128d769ff778d9b29343fb3496472dc20dabe", + "sha256:f341ee2df0999bfdf7a95e448075effe0db212a59387de1a70690e4acb03d4c6", + "sha256:f7f325be2804246a75a4f45c72d4ce80d2443ab815063cdf70ee8fb2ca59ee1b", + "sha256:f8af619e3be812a2059b212064ea7a640aff0568d972cd1b9e920837469eb3cb", + "sha256:fa8c626d6441e2d04b6ee703ef2d1e17608ad44c7cb75258c09dd42bacdfc64b", + "sha256:fbb9dc00e39f3e6c0ef48edee202f9520dafb233e8b51b06b8428cfcb92abd30", + "sha256:fff55f3ce50a3ff63ec8e2a8d3dd924f1941b250b0aac3d3d42b687eeff07a8e" + ], + "version": "==2021.11.10" }, "requests": { "hashes": [ @@ -809,6 +706,14 @@ "index": "pypi", "version": "==1.6.1" }, + "setuptools": { + "hashes": [ + "sha256:157d21de9d055ab9e8ea3186d91e7f4f865e11f42deafa952d90842671fc2576", + "sha256:4adde3d1e1c89bde1c643c64d89cdd94cbfd8c75252ee459d4500bccb9c7d05d" + ], + "markers": "python_version >= '3.6'", + "version": "==59.2.0" + }, "six": { "hashes": [ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", @@ -851,38 +756,28 @@ }, "typed-ast": { "hashes": [ - "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060be5dad2c730ace", - "sha256:067a74454df670dcaa4e59349a2e5c81e567d8d65458d480a5b3dfecec08c5ff", - "sha256:0fb71b8c643187d7492c1f8352f2c15b4c4af3f6338f21681d3681b3dc31a266", - "sha256:1b3ead4a96c9101bef08f9f7d1217c096f31667617b58de957f690c92378b528", - "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6", - "sha256:209596a4ec71d990d71d5e0d312ac935d86930e6eecff6ccc7007fe54d703808", - "sha256:2c726c276d09fc5c414693a2de063f521052d9ea7c240ce553316f70656c84d4", - "sha256:398e44cd480f4d2b7ee8d98385ca104e35c81525dd98c519acff1b79bdaac363", - "sha256:52b1eb8c83f178ab787f3a4283f68258525f8d70f778a2f6dd54d3b5e5fb4341", - "sha256:5feca99c17af94057417d744607b82dd0a664fd5e4ca98061480fd8b14b18d04", - "sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088a1636180f11a41", - "sha256:760ad187b1041a154f0e4d0f6aae3e40fdb51d6de16e5c99aedadd9246450e9e", - "sha256:777a26c84bea6cd934422ac2e3b78863a37017618b6e5c08f92ef69853e765d3", - "sha256:95431a26309a21874005845c21118c83991c63ea800dd44843e42a916aec5899", - "sha256:9ad2c92ec681e02baf81fdfa056fe0d818645efa9af1f1cd5fd6f1bd2bdfd805", - "sha256:9c6d1a54552b5330bc657b7ef0eae25d00ba7ffe85d9ea8ae6540d2197a3788c", - "sha256:aee0c1256be6c07bd3e1263ff920c325b59849dc95392a05f258bb9b259cf39c", - "sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f22ee626a7b88e39", - "sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb608a65c3a49e1a", - "sha256:b9574c6f03f685070d859e75c7f9eeca02d6933273b5e69572e5ff9d5e3931c3", - "sha256:bff6ad71c81b3bba8fa35f0f1921fb24ff4476235a6e94a26ada2e54370e6da7", - "sha256:c190f0899e9f9f8b6b7863debfb739abcb21a5c054f911ca3596d12b8a4c4c7f", - "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708bffe863cbe4075", - "sha256:cae53c389825d3b46fb37538441f75d6aecc4174f615d048321b716df2757fb0", - "sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063ad102fe9c425e40", - "sha256:dde816ca9dac1d9c01dd504ea5967821606f02e510438120091b84e852367428", - "sha256:f2362f3cb0f3172c42938946dbc5b7843c2a28aec307c49100c8b38764eb6927", - "sha256:f328adcfebed9f11301eaedfa48e15bdece9b519fb27e6a8c01aa52a17ec31b3", - "sha256:f8afcf15cc511ada719a88e013cec87c11aff7b91f019295eb4530f96fe5ef2f", - "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65" - ], - "version": "==1.4.3" + "sha256:14fed8820114a389a2b7e91624db5f85f3f6682fda09fe0268a59aabd28fe5f5", + "sha256:155b74b078be842d2eb630dd30a280025eca0a5383c7d45853c27afee65f278f", + "sha256:224afecb8b39739f5c9562794a7c98325cb9d972712e1a98b6989a4720219541", + "sha256:361b9e5d27bd8e3ccb6ea6ad6c4f3c0be322a1a0f8177db6d56264fa0ae40410", + "sha256:37ba2ab65a0028b1a4f2b61a8fe77f12d242731977d274a03d68ebb751271508", + "sha256:49af5b8f6f03ed1eb89ee06c1d7c2e7c8e743d720c3746a5857609a1abc94c94", + "sha256:51040bf45aacefa44fa67fb9ebcd1f2bec73182b99a532c2394eea7dabd18e24", + "sha256:52ca2b2b524d770bed7a393371a38e91943f9160a190141e0df911586066ecda", + "sha256:618912cbc7e17b4aeba86ffe071698c6e2d292acbd6d1d5ec1ee724b8c4ae450", + "sha256:65c81abbabda7d760df7304d843cc9dbe7ef5d485504ca59a46ae2d1731d2428", + "sha256:7b310a207ee9fde3f46ba327989e6cba4195bc0c8c70a158456e7b10233e6bed", + "sha256:7e6731044f748340ef68dcadb5172a4b1f40847a2983fe3983b2a66445fbc8e6", + "sha256:806e0c7346b9b4af8c62d9a29053f484599921a4448c37fbbcbbf15c25138570", + "sha256:a67fd5914603e2165e075f1b12f5a8356bfb9557e8bfb74511108cfbab0f51ed", + "sha256:e4374a76e61399a173137e7984a1d7e356038cf844f24fd8aea46c8029a2f712", + "sha256:e8a9b9c87801cecaad3b4c2b8876387115d1a14caa602c1618cedbb0cb2a14e6", + "sha256:ea517c2bb11c5e4ba7a83a91482a2837041181d57d3ed0749a6c382a2b6b7086", + "sha256:ec184dfb5d3d11e82841dbb973e7092b75f306b625fad7b2e665b64c5d60ab3f", + "sha256:ff4ad88271aa7a55f19b6a161ed44e088c393846d954729549e3cde8257747bb" + ], + "markers": "python_version >= '3.6'", + "version": "==1.5.0" }, "types-six": { "hashes": [ @@ -894,11 +789,11 @@ }, "typing-extensions": { "hashes": [ - "sha256:49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e", - "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7", - "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34" + "sha256:2cdf80e4e04866a9b3689a51869016d36db0814d84b8d8a568d22781d45d27ed", + "sha256:829704698b22e13ec9eaf959122315eabb370b0884400e9818334d8b677023d9" ], - "version": "==3.10.0.2" + "markers": "python_version >= '3.6'", + "version": "==4.0.0" }, "urllib3": { "hashes": [ diff --git a/pipenv_setup/setup_updater.py b/pipenv_setup/setup_updater.py index b0462e0..9ed8927 100644 --- a/pipenv_setup/setup_updater.py +++ b/pipenv_setup/setup_updater.py @@ -1,16 +1,19 @@ import ast import codecs -import sys import tokenize from io import BytesIO -from subprocess import Popen, PIPE from tokenize import OP -from typing import Tuple, List, Any +from types import ModuleType +from typing import TYPE_CHECKING, Any, List, Optional, Tuple, no_type_check from vistir.compat import Path from pipenv_setup import setup_parser -from pipenv_setup.setup_parser import get_setup_call_node, get_kw_list_node +from pipenv_setup.setup_parser import get_kw_list_node, get_setup_call_node + +if TYPE_CHECKING: # this is used for IDEs later on + import autopep8 # pragma: no cover + import black # pragma: no cover def update_setup( @@ -140,25 +143,61 @@ def update_setup( format_file(Path("setup.py")) -def format_file(file): # type: (Path) -> None +def _get_formatting_module(): # type: () -> Optional[ModuleType] """ - use black or autopep8 to format python file + retrieve the correct formatting module if one is installed + + :return: formatting module (`black` or `autopep8`) if installed; otherwise `None` """ try: - # noinspection PyPackageRequirements import black + except: - with Popen( - [sys.executable, "-m", "black", str(file)], stdout=PIPE, stderr=PIPE - ) as p: - p.communicate() + try: + import autopep8 + except ImportError: + return None + return autopep8 - except ImportError: - # use autopep8 - import autopep8 + return black - code = autopep8.fix_code(file.read_text()) - file.write_text(code) + +@no_type_check # IDK how to get mypy to play nicely with the `mod` variable +def format_file(file): # type: (Path) -> None + """ + use black or autopep8 to format python file + + if neither is installed, do nothing + """ + mod = _get_formatting_module() + if not mod: + return + + if mod.__name__ == "black": + if TYPE_CHECKING: # for IDEs + mod = black # pragma: no cover + + mode = mod.FileMode( + target_versions=set(), + line_length=mod.DEFAULT_LINE_LENGTH, + is_pyi=False, + string_normalization=True, + ) + write_back = mod.WriteBack.from_configuration(check=False, diff=False) + report = mod.Report(check=False, quiet=False, verbose=False) + + mod.reformat_one( + src=file, fast=False, write_back=write_back, mode=mode, report=report + ) + return + + if mod.__name__ == "autopep8": + if TYPE_CHECKING: # for IDEs + mod = autopep8 # pragma: no cover + raw = file.read_text() + formatted = mod.fix_code(raw) + file.write_text(formatted) + return def insert_at_lineno_col_offset( diff --git a/setup.py b/setup.py index 2f7125f..defab2a 100644 --- a/setup.py +++ b/setup.py @@ -136,6 +136,7 @@ # https://packaging.python.org/en/latest/requirements.html extras_require={ "dev": [ + "black==19.10b0; python_version >= '3.6'", "pytest~=5.2; python_version >= '3.6'", "pytest-mypy>=0.8; python_version >= '3.5'", "pytest-cov~=2.7", @@ -144,19 +145,19 @@ "tox~=3.14", "autopep8~=1.4", "types-six", - ] + ], + "black": ["black"], + "autopep8": ["autopep8"], }, install_requires=[ "pipfile~=0.0", - "black==19.10b0; python_version >= '3.6'", "colorama~=0.4", "packaging~=20.0", "requirementslib~=1.5", "vistir~=0.4", - "autopep8~=1.4; python_version < '3.6'", "six~=1.12", "typing~=3.7; python_version < '3.7'", - "chardet>=3.0.0,<=5.0.0", + "chardet<=5.0.0,>=3.0.0", "pyparsing!=3.0.5", ], # Optional entry_points={ diff --git a/tests/setup_updater_test.py b/tests/setup_updater_test.py index 9b7cdb8..9b8e9f9 100644 --- a/tests/setup_updater_test.py +++ b/tests/setup_updater_test.py @@ -1,7 +1,61 @@ from collections import defaultdict +from platform import python_version +from typing import Callable + +import pytest +from _pytest.monkeypatch import MonkeyPatch +from pipenv_setup import setup_updater from vistir.compat import Path + from .conftest import data -from pipenv_setup import setup_updater + + +@pytest.fixture +def dummy_import(monkeypatch): # (MonkeyPatch) -> Callable + """ + This fixture monkeypatches the import mechanism to fail. + + After raising an `ImportError`, the monkeypatch is immediately removed. + """ + + def dummy_import(*args, **kwargs): + try: + raise ImportError("this is a monkeypatch") + finally: + monkeypatch.undo() + + return dummy_import + + +@pytest.fixture +def extra_dummy_import(monkeypatch): # (MonkeyPatch) -> Callable + """ + similar to the `dummy_import` fixture, except it causes two import failures + """ + monkeypatch.n_import = 0 + + def extra_dummy_import(*args, **kwargs): + try: + raise ImportError( + "this is a monkeypatch for import #%d" % monkeypatch.n_import + ) + finally: + if monkeypatch.n_import: + monkeypatch.undo() + else: + monkeypatch.n_import += 1 + + return extra_dummy_import + + +def patch_import(monkeypatch, dummy_import): # type: (MonkeyPatch, Callable) -> None + """ + monkeypatch the builtin __import__ function with the given function + """ + try: + monkeypatch.setattr("builtins.__import__", dummy_import) + except ImportError: # raised by python2.7 (no `builtins` module) + monkeypatch.setattr("__builtin__.__import__", dummy_import) def test_no_unnecessary_dependency_link(tmp_path): @@ -16,3 +70,77 @@ def test_no_unnecessary_dependency_link(tmp_path): setup_updater.update_setup(defaultdict(list), path / "setup.py") assert "dependency_links=[]," not in setup_file.read_text() + + +def test_monkeypatch_import( + monkeypatch, dummy_import +): # type: (MonkeyPatch, Callable) -> None + """ + verify that the builtin __import__ function can be monkeypatched + """ + with pytest.raises(ImportError): + patch_import(monkeypatch, dummy_import) + import black + + +@pytest.mark.xfail( + float(python_version()[:3]) < 3.6, reason="black requires python >= 3.6" +) +def test_black(): # type: () -> None + """ + test the nominal case when `black` is returned + """ + import black + + is_black = setup_updater._get_formatting_module() + + assert is_black is black + + +@pytest.mark.xfail( + float(python_version()[:3]) < 3.6, reason="black requires python >= 3.6" +) +def test_not_black(monkeypatch, dummy_import): # type: (MonkeyPatch, Callable) -> None + """ + verify `black` import failures provide an alternative formatter (or None) + """ + import black + + patch_import(monkeypatch, dummy_import) + is_not_black = setup_updater._get_formatting_module() + + assert is_not_black is not black + + +def test_autopep8(monkeypatch, dummy_import): # type: (MonkeyPatch, Callable) -> None + """ + verify `autopep8` is returned if `black` isn't present but `autopep8` is + """ + import autopep8 + + patch_import(monkeypatch, dummy_import) + is_autopep8 = setup_updater._get_formatting_module() + + assert is_autopep8 is autopep8 + + +def test_none(monkeypatch, extra_dummy_import): # type: (MonkeyPatch, Callable) -> None + """ + verify `None` is returned if neither `black` nor `autopep8` is present + """ + patch_import(monkeypatch, extra_dummy_import) + is_none = setup_updater._get_formatting_module() + + assert is_none is None + + +def test_format_file( + monkeypatch, extra_dummy_import +): # type: (MonkeyPatch, Callable) -> None + """ + perform the same test as `test_none`, just with the parent function + + closes issue #34 (https://github.com/Madoshakalaka/pipenv-setup/issues/34) + """ + patch_import(monkeypatch, extra_dummy_import) + setup_updater.format_file(Path(__file__))