From a733309eedab8e6a6321d9368efdc60a00260e14 Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Mon, 13 Nov 2023 14:55:43 +0000 Subject: [PATCH] Replace Black with Ruff --- Pipfile | 3 +- Pipfile.lock | 135 ++++++++++++++++++---------------------- README.md | 4 +- ec_api/settings/base.py | 2 +- pyproject.toml | 3 - 5 files changed, 65 insertions(+), 82 deletions(-) diff --git a/Pipfile b/Pipfile index 7ff2fc8..e779883 100644 --- a/Pipfile +++ b/Pipfile @@ -31,6 +31,7 @@ typing-extensions = ">=3.7.4" pre-commit = "*" pytest = "*" pytest-django = "*" +pytest-ruff = "*" pytest-env = "<=0.8.1" coveralls = ">=3.1.1" pytest-cov = "<=4.0.0" @@ -38,7 +39,7 @@ factory-boy = "*" ipython = "*" pytest-mock = "*" ipdb = "*" -pytest-socket = "==0.5.1" +pytest-socket = "==0.6.0" wheel = ">0.37.0" ruff = "==0.1.5" diff --git a/Pipfile.lock b/Pipfile.lock index b949bcc..37ab1b3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "5694af721b754c7d3c70be30add3123c6ed8dbd5fee543825f8c68c224a1408a" + "sha256": "9c41265e2576791b3f7bc7bfce943ad6ecae9a14e2eb28c167e976b83cf571ef" }, "pipfile-spec": 6, "requires": { @@ -30,28 +30,28 @@ }, "boto3": { "hashes": [ - "sha256:98b01bbea27740720a06f7c7bc0132ae4ce902e640aab090cfb99ad3278449c3", - "sha256:adfb915958d7b54d876891ea1599dd83189e35a2442eb41ca52b04ea716180b6" + "sha256:ca9b04fc2c75990c2be84c43b9d6edecce828960fc27e07ab29036587a1ca635", + "sha256:d1135647309b89376a014d21407aabfa322998206175f2297def812bf4d824a9" ], "markers": "python_version >= '3.7'", - "version": "==1.28.84" + "version": "==1.29.4" }, "botocore": { "hashes": [ - "sha256:8913bedb96ad0427660dee083aeaa675466eb662bbf1a47781956b5882aadcc5", - "sha256:d65bc05793d1a8a8c191a739f742876b4b403c5c713dc76beef262d18f7984a2" + "sha256:3ee73c0d93bdb944d0c46772f08f09cdcf25ef58bd86962e6f4a24e531198bfa", + "sha256:6bfa75e28c9ad0321cefefa51b00ff233b16b2416f8b95229796263edba45a39" ], "markers": "python_version >= '3.7'", - "version": "==1.31.84" + "version": "==1.32.4" }, "certifi": { "hashes": [ - "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", - "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9" + "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1", + "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474" ], "index": "pypi", "markers": "python_version >= '3.6'", - "version": "==2023.7.22" + "version": "==2023.11.17" }, "cffi": { "hashes": [ @@ -232,12 +232,12 @@ }, "django-cors-headers": { "hashes": [ - "sha256:25aabc94d4837678c1edf442c7f68a5f5fd151f6767b0e0b01c61a2179d02711", - "sha256:bd36c7aea0d070e462f3383f0dc9ef717e5fdc2b10a99c98c285f16da84ffba2" + "sha256:0b1fd19297e37417fc9f835d39e45c8c642938ddba1acce0c1753d3edef04f36", + "sha256:0bf65ef45e606aff1994d35503e6b677c0b26cafff6506f8fd7187f3be840207" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==4.3.0" + "version": "==4.3.1" }, "django-debug-toolbar": { "hashes": [ @@ -285,12 +285,12 @@ }, "faker": { "hashes": [ - "sha256:171b27ba106cf69e30a91ac471407c2362bd6af27738e2461dc441aeff5eed91", - "sha256:df44b68b9d231e784f4bfe616d781576cfef9f0c5d9a17671bf84dc10d7b44d6" + "sha256:562a3a09c3ed3a1a7b20e13d79f904dfdfc5e740f72813ecf95e4cf71e5a2f52", + "sha256:aeb3e26742863d1e387f9d156f1c36e14af63bf5e6f36fb39b8c27f6a903be38" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==20.0.0" + "version": "==20.1.0" }, "idna": { "hashes": [ @@ -437,7 +437,7 @@ "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==2.8.2" }, "python-memcached": { @@ -471,30 +471,6 @@ "markers": "python_version >= '3.7'", "version": "==2.31.0" }, - "ruff": { - "hashes": [ - "sha256:171276c1df6c07fa0597fb946139ced1c2978f4f0b8254f201281729981f3c17", - "sha256:17ef33cd0bb7316ca65649fc748acc1406dfa4da96a3d0cde6d52f2e866c7b39", - "sha256:32d47fc69261c21a4c48916f16ca272bf2f273eb635d91c65d5cd548bf1f3d96", - "sha256:5cbec0ef2ae1748fb194f420fb03fb2c25c3258c86129af7172ff8f198f125ab", - "sha256:721f4b9d3b4161df8dc9f09aa8562e39d14e55a4dbaa451a8e55bdc9590e20f4", - "sha256:82bfcb9927e88c1ed50f49ac6c9728dab3ea451212693fe40d08d314663e412f", - "sha256:9b97fd6da44d6cceb188147b68db69a5741fbc736465b5cea3928fdac0bc1aeb", - "sha256:a00a7ec893f665ed60008c70fe9eeb58d210e6b4d83ec6654a9904871f982a2a", - "sha256:a4894dddb476597a0ba4473d72a23151b8b3b0b5f958f2cf4d3f1c572cdb7af7", - "sha256:a8c11206b47f283cbda399a654fd0178d7a389e631f19f51da15cbe631480c5b", - "sha256:aafb9d2b671ed934998e881e2c0f5845a4295e84e719359c71c39a5363cccc91", - "sha256:b2c205827b3f8c13b4a432e9585750b93fd907986fe1aec62b2a02cf4401eee6", - "sha256:bb408e3a2ad8f6881d0f2e7ad70cddb3ed9f200eb3517a91a245bbe27101d379", - "sha256:c21fe20ee7d76206d290a76271c1af7a5096bc4c73ab9383ed2ad35f852a0087", - "sha256:f20dc5e5905ddb407060ca27267c7174f532375c08076d1a953cf7bb016f5a24", - "sha256:f80c73bba6bc69e4fdc73b3991db0b546ce641bdcd5b07210b8ad6f64c79f1ab", - "sha256:fa29e67b3284b9a79b1a85ee66e293a94ac6b7bb068b307a8a373c3d343aa8ec" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==0.1.5" - }, "s3transfer": { "hashes": [ "sha256:10d6923c6359175f264811ef4bf6161a3156ce8e350e705396a7557d6293c33a", @@ -505,18 +481,18 @@ }, "sentry-sdk": { "hashes": [ - "sha256:04e392db9a0d59bd49a51b9e3a92410ac5867556820465057c2ef89a38e953e9", - "sha256:a7865952701e46d38b41315c16c075367675c48d049b90a4cc2e41991ebc7efa" + "sha256:25d574f94fdf72199e331c2401fdac60d01b5be8f32822174c51c3ff0fc2f8cb", + "sha256:f32dd16547f2f45e1c71a96fd4a48925e629541f7ddfe3d5d25ef7d5e94eb3c8" ], "index": "pypi", - "version": "==1.35.0" + "version": "==1.36.0" }, "six": { "hashes": [ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==1.16.0" }, "sqlparse": { @@ -572,12 +548,12 @@ }, "certifi": { "hashes": [ - "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", - "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9" + "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1", + "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474" ], "index": "pypi", "markers": "python_version >= '3.6'", - "version": "==2023.7.22" + "version": "==2023.11.17" }, "cfgv": { "hashes": [ @@ -775,11 +751,11 @@ }, "exceptiongroup": { "hashes": [ - "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9", - "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3" + "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14", + "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68" ], "markers": "python_version < '3.11'", - "version": "==1.1.3" + "version": "==1.2.0" }, "executing": { "hashes": [ @@ -800,12 +776,12 @@ }, "faker": { "hashes": [ - "sha256:171b27ba106cf69e30a91ac471407c2362bd6af27738e2461dc441aeff5eed91", - "sha256:df44b68b9d231e784f4bfe616d781576cfef9f0c5d9a17671bf84dc10d7b44d6" + "sha256:562a3a09c3ed3a1a7b20e13d79f904dfdfc5e740f72813ecf95e4cf71e5a2f52", + "sha256:aeb3e26742863d1e387f9d156f1c36e14af63bf5e6f36fb39b8c27f6a903be38" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==20.0.0" + "version": "==20.1.0" }, "filelock": { "hashes": [ @@ -817,11 +793,11 @@ }, "identify": { "hashes": [ - "sha256:7736b3c7a28233637e3c36550646fc6389bedd74ae84cb788200cc8e2dd60b75", - "sha256:90199cb9e7bd3c5407a9b7e81b4abec4bb9d249991c79439ec8af740afc6293d" + "sha256:0b7656ef6cba81664b783352c73f8c24b39cf82f926f78f4550eda928e5e0545", + "sha256:5d9979348ec1a21c768ae07e0a652924538e8bce67313a73cb0f681cf08ba407" ], "markers": "python_version >= '3.8'", - "version": "==2.5.31" + "version": "==2.5.32" }, "idna": { "hashes": [ @@ -932,11 +908,11 @@ }, "prompt-toolkit": { "hashes": [ - "sha256:99ba3dfb23d5b5af89712f89e60a5f3d9b8b67a9482ca377c5771d0e9047a34b", - "sha256:a371c06bb1d66cd499fecd708e50c0b6ae00acba9822ba33c586e2f16d1b739e" + "sha256:941367d97fc815548822aa26c2a269fdc4eb21e9ec05fc5d447cf09bad5d75f0", + "sha256:f36fe301fafb7470e86aaf90f036eef600a3210be4decf461a5b1ca8403d3cb2" ], "markers": "python_full_version >= '3.7.0'", - "version": "==3.0.40" + "version": "==3.0.41" }, "ptyprocess": { "hashes": [ @@ -954,11 +930,11 @@ }, "pygments": { "hashes": [ - "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692", - "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29" + "sha256:1b37f1b1e1bff2af52ecaf28cc601e2ef7077000b227a0675da25aef85784bc4", + "sha256:e45a0e74bf9c530f564ca81b8952343be986a29f6afe7f5ad95c5f06b7bdf5e8" ], "markers": "python_version >= '3.7'", - "version": "==2.16.1" + "version": "==2.17.1" }, "pytest": { "hashes": [ @@ -1005,21 +981,30 @@ "markers": "python_version >= '3.8'", "version": "==3.12.0" }, + "pytest-ruff": { + "hashes": [ + "sha256:078ad696bfa347b466991ed4f9cc5ec807f5a171d7f06091660d8f16ba03a5dc", + "sha256:f586bbd7978cb5782b673c8e55fa069d83430139931b918bd72232ba3f71eb67" + ], + "index": "pypi", + "markers": "python_version >= '3.7' and python_version < '4.0'", + "version": "==0.2.1" + }, "pytest-socket": { "hashes": [ - "sha256:7c4b81dc6a51cbc0093f11791de00ff4a15ac698f5da96879a80f5d9ad4179b6", - "sha256:8726fd47b83b127451532b6d570c5b6c4cd204fca363936509b1f53195de6f4f" + "sha256:363c1d67228315d4fc7912f1aabfd570de29d0e3db6217d61db5728adacd7138", + "sha256:cca72f134ff01e0023c402e78d31b32e68da3efdf3493bf7788f8eba86a6824c" ], "index": "pypi", "markers": "python_version >= '3.7' and python_version < '4.0'", - "version": "==0.5.1" + "version": "==0.6.0" }, "python-dateutil": { "hashes": [ "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==2.8.2" }, "pyyaml": { @@ -1113,18 +1098,18 @@ }, "setuptools": { "hashes": [ - "sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87", - "sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a" + "sha256:6875bbd06382d857b1b90cd07cee6a2df701a164f241095706b5192bc56c5c62", + "sha256:f25195d54deb649832182d6455bffba7ac3d8fe71d35185e738d2198a4310044" ], "markers": "python_version >= '3.8'", - "version": "==68.2.2" + "version": "==69.0.1" }, "six": { "hashes": [ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==1.16.0" }, "stack-data": { @@ -1139,7 +1124,7 @@ "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" ], - "markers": "python_version < '3.11' and python_version >= '3.7'", + "markers": "python_version < '3.11'", "version": "==2.0.1" }, "traitlets": { @@ -1168,10 +1153,10 @@ }, "wcwidth": { "hashes": [ - "sha256:9a929bd8380f6cd9571a968a9c8f4353ca58d7cd812a4822bba831f8d685b223", - "sha256:a675d1a4a2d24ef67096a04b85b02deeecd8e226f57b5e3a72dbb9ed99d27da8" + "sha256:25eb3ecbec328cdb945f56f2a7cfe784bdf7a73a8197398c7a7c65e7fe93e9ae", + "sha256:c4b153acf29f1f0d7fb1b00d097cce82b73de7a2016321c8d7ca71bd76dd848b" ], - "version": "==0.2.9" + "version": "==0.2.11" }, "wheel": { "hashes": [ diff --git a/README.md b/README.md index 0e124f0..754350b 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ This section assumes a working python 3.8 environment with Pipenv installed. * `cp ec_api/settings/local.py.example ec_api/settings/local.py` * Install Python dependencies: `pipenv install --dev` * Run the test suite: `pytest` -* Run lint checks: `pytest --flakes` -* Auto-format: `black .` +* Run lint checks: `ruff .` +* Auto-format: `ruff format .` ## Pre-commit diff --git a/ec_api/settings/base.py b/ec_api/settings/base.py index 3073644..797ed87 100644 --- a/ec_api/settings/base.py +++ b/ec_api/settings/base.py @@ -180,7 +180,7 @@ def root(*path): } PIPELINE["SASS_ARGUMENTS"] = ( - " -I " + dc_design_system.DC_SYSTEM_PATH + "/system" + " -I " + dc_design_system.DC_SYSTEM_PATH + "/system" ) PIPELINE["CSS_COMPRESSOR"] = "pipeline.compressors.NoopCompressor" diff --git a/pyproject.toml b/pyproject.toml index 9275af9..fd2ce38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,9 +7,6 @@ target-version = ['py38'] norecursedirs = ".git __pycache__ .aws-sam" addopts = "--ignore=*/__pycache__ --ignore=.* --disable-socket" python_files = "test_*.py" -flakes-ignore = [ - "ImportStarUsage" -] env = "RUN_ENV=test" DJANGO_SETTINGS_MODULE = "ec_api.settings.testing" FAIL_INVALID_TEMPLATE_VARS = "1"