diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09d90772..b73ad7ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: true matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: #---------------------------------------------- # check-out repo and set-up python diff --git a/CHANGES.rst b/CHANGES.md similarity index 73% rename from CHANGES.rst rename to CHANGES.md index 35266bcf..40dc5289 100644 --- a/CHANGES.rst +++ b/CHANGES.md @@ -1,211 +1,147 @@ -Changelog ---------- +# Changelog -0.20.0 (2022-06-05) -^^^^^^^^^^^^^^^^^^^ +## 0.20.0 (2022-06-05) - Added ipv4 digit lenghts validation (#191, pull request courtesy of Norbiox) - Fixes error with international URLs that have more than 2 hyphens (#184, pull request courtesy of automationator) - -0.19.0 (2022-05-04) -^^^^^^^^^^^^^^^^^^^ +## 0.19.0 (2022-05-04) - Dropped py34 support - Improve IPv6 validation (#201, pull request courtesy of SimonIT) - -0.18.2 (2020-12-18) -^^^^^^^^^^^^^^^^^^^ +## 0.18.2 (2020-12-18) - Implement actual validation for old style BTC addresses including checksumming (#182, pull request courtesy of tpatja) - Use a regex to guesstimate validity of new segwit BTC addresses (#182, pull request courtesy of tpatja) - -0.18.1 (2020-09-03) -^^^^^^^^^^^^^^^^^^^ +## 0.18.1 (2020-09-03) - Made uuid validator accept UUID objects (#174, pull request courtesy of Letsch22) - -0.18.0 (2020-08-19) -^^^^^^^^^^^^^^^^^^^ +## 0.18.0 (2020-08-19) - Added bitcoin address validator (#166, pull request courtesy of daveusa31) - -0.17.1 (2020-08-03) -^^^^^^^^^^^^^^^^^^^ +## 0.17.1 (2020-08-03) - Fixed python_requires using twine - -0.17.0 (2020-08-02) -^^^^^^^^^^^^^^^^^^^ +## 0.17.0 (2020-08-02) - Added python_requires='>=3.4' to setup.py (#163, pull request courtesy of vphilippon) - Fixed URL validator ip_last_octet regex (#145, pull request courtesy of ghost) - -0.16.0 (2020-07-16) -^^^^^^^^^^^^^^^^^^^ +## 0.16.0 (2020-07-16) - Added support for emojis and more IDNA URLs (#161, pull request courtesy of automationator) - -0.15.0 (2020-05-07) -^^^^^^^^^^^^^^^^^^^ +## 0.15.0 (2020-05-07) - Added bank card validators (#157, pull request courtesy of TimonPeng) - -0.14.3 (2020-02-04) -^^^^^^^^^^^^^^^^^^^ +## 0.14.3 (2020-04-02) - Handle None values gracefully in domain validator (#144, pull request courtesy reahaas) - Local part of the email address should be less or equal than 64 bytes (#147, pull request courtesy mondeja) - Removed py27 support - Removed pypy2 support - -0.14.2 (2020-01-24) -^^^^^^^^^^^^^^^^^^^ +## 0.14.2 (2020-01-24) - Made domain validation case-insensitive (#136, pull request courtesy ehmkah) - -0.14.1 (2019-12-04) -^^^^^^^^^^^^^^^^^^^ +## 0.14.1 (2019-12-04) - Updated domain validator regex to not allow numeric only TLDs (#133, pull request courtesy jmeridth) - Allow for idna encoded domains (#133, pull request courtesy jmeridth) - -0.14.0 (2019-08-21) -^^^^^^^^^^^^^^^^^^^ +## 0.14.0 (2019-08-21) - Added new validators ``ipv4_cidr``, ``ipv6_cidr`` (#117, pull request courtesy woodruffw) - -0.13.0 (2019-05-20) -^^^^^^^^^^^^^^^^^^^ +## 0.13.0 (2019-05-20) - Added new validator: ``es_doi``, ``es_nif``, ``es_cif``, ``es_nie`` (#121, pull request courtesy kingbuzzman) - -0.12.6 (2019-05-08) -^^^^^^^^^^^^^^^^^^^ +## 0.12.6 (2019-05-08) - Fixed domain validator for single character domains (#118, pull request courtesy kingbuzzman) - -0.12.5 (2019-04-15) -^^^^^^^^^^^^^^^^^^^ +## 0.12.5 (2019-04-15) - Fixed py37 support (#113, pull request courtesy agiletechnologist) - -0.12.4 (2019-01-02) -^^^^^^^^^^^^^^^^^^^ +## 0.12.4 (2019-01-02) - Use inspect.getfullargspec() in py3 (#110, pull request courtesy riconnon) - -0.12.3 (2018-11-13) -^^^^^^^^^^^^^^^^^^^ +## 0.12.3 (2018-11-13) - Added `allow_temporal_ssn` parameter to fi_ssn validator (#97, pull request courtesy quantus) - Remove py33 support - -0.12.2 (2018-06-03) -^^^^^^^^^^^^^^^^^^^ +## 0.12.2 (2018-06-03) - Fixed IPv4 formatted IP address returning True on ipv6 (#85, pull request courtesy johndlong) - Fixed IPv6 address parsing (#83, pull request courtesy JulianKahnert) - Fixed domain validator for international domains and certain edge cases (#76, pull request courtesy Ni-Knight) - -0.12.1 (2018-01-30) -^^^^^^^^^^^^^^^^^^^ +## 0.12.1 (2018-01-30) - Fixed IDNA encoded TLDs in domain validator (#75, pull request courtesy piewpiew) - Fixed URL validator for URLs with invalid characters in userinfo part (#69, pull request courtesy timb07) - -0.12.0 (2017-06-03) -^^^^^^^^^^^^^^^^^^^ +## 0.12.0 (2017-06-03) - Added hash validators for md5, sha1, sha224, sha256 and sha512 - Made ipv6 validator support IPv4-mapped IPv6 addresses - -0.11.3 (2017-03-27) -^^^^^^^^^^^^^^^^^^^ +## 0.11.3 (2017-03-27) - Fixed URL validator for URLs containing localhost (#51, pull request courtesy vladimirdotk) - -0.11.2 (2017-01-08) -^^^^^^^^^^^^^^^^^^^ +## 0.11.2 (2017-01-08) - Fixed URL validator for urls with query parameters but without path (#44, pull request courtesy zjjw) - -0.11.1 (2016-11-19) -^^^^^^^^^^^^^^^^^^^ +## 0.11.1 (2016-11-19) - Fixed pyp2rpm build problem (#37, pull request courtesy BOPOHA) - -0.11.0 (2016-08-30) -^^^^^^^^^^^^^^^^^^^ +## 0.11.0 (2016-08-30) - Fixed public url validation (#29) - Made URL validator case insensitive (#27) - Drop Python 2.6 support - -0.10.3 (2016-06-13) -^^^^^^^^^^^^^^^^^^^ +## 0.10.3 (2016-06-13) - Added ``public`` parameter to url validator (#26, pull request courtesy Iconceicao) - -0.10.2 (2016-06-11) -^^^^^^^^^^^^^^^^^^^ +## 0.10.2 (2016-06-11) - Fixed various URL validation issues - -0.10.1 (2016-04-09) -^^^^^^^^^^^^^^^^^^^ +## 0.10.1 (2016-04-09) - Fixed domain name validation for numeric domain names (#21, pull request courtesy shaunpud) - Fixed IBAN validation for Norwegian and Belgian IBANs (#17, pull request courtesy mboelens91) - -0.10.0 (2016-01-09) -^^^^^^^^^^^^^^^^^^^ +## 0.10.0 (2016-01-09) - Added support for internationalized domain names in ``domain`` validator - -0.9.0 (2015-10-10) -^^^^^^^^^^^^^^^^^^ +## 0.9.0 (2015-10-10) - Added new validator: ``domain`` - Added flake8 and isort checks in travis config - -0.8.0 (2015-06-24) -^^^^^^^^^^^^^^^^^^ +## 0.8.0 (2015-06-24) - Added new validator: ``iban`` - -0.7.0 (2014-09-07) -^^^^^^^^^^^^^^^^^^ +## 0.7.0 (2014-09-07) - Fixed errors in code examples. - Fixed ``TypeError`` when using ``between`` validator with ``datetime`` objects @@ -215,39 +151,28 @@ Changelog - Fixed ``truthy`` validator to work like it's name suggests. Previously it worked like ``falsy``. -0.6.0 (2014-06-25) -^^^^^^^^^^^^^^^^^^ +## 0.6.0 (2014-06-25) - Added new validator: ``slug`` - -0.5.0 (2013-10-31) -^^^^^^^^^^^^^^^^^^ +## 0.5.0 (2013-10-31) - Renamed ``finnish_business_id`` to ``fi_business_id`` - Added new validator: ``fi_ssn`` - -0.4.0 (2013-10-29) -^^^^^^^^^^^^^^^^^^ +## 0.4.0 (2013-10-29) - Added new validator: ``finnish_business_id`` - -0.3.0 (2013-10-27) -^^^^^^^^^^^^^^^^^^ +## 0.3.0 (2013-10-27) - ``number_range`` -> ``between`` - -0.2.0 (2013-10-22) -^^^^^^^^^^^^^^^^^^ +## 0.2.0 (2013-10-22) - Various new validators: ``ipv4``, ``ipv6``, ``length``, ``number_range``, ``mac_address``, ``url``, ``uuid`` - -0.1.0 (2013-10-18) -^^^^^^^^^^^^^^^^^^ +## 0.1.0 (2013-10-18) - Initial public release diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index cd079497..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include CHANGES.rst LICENSE README.rst -recursive-include tests * -recursive-exclude tests *.pyc -recursive-include docs * -recursive-exclude docs *.pyc -prune docs/_build -exclude docs/_themes/.git diff --git a/poetry.lock b/poetry.lock index ba1ad2d0..32d21038 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. [[package]] name = "attrs" @@ -37,7 +37,6 @@ GitPython = ">=1.0.1" PyYAML = ">=5.3.1" rich = "*" stevedore = ">=1.20.0" -tomli = {version = ">=1.1.0", optional = true, markers = "python_version < \"3.11\" and extra == \"toml\""} [package.extras] test = ["beautifulsoup4 (>=4.8.0)", "coverage (>=4.5.4)", "fixtures (>=3.0.0)", "flake8 (>=4.0.0)", "pylint (==1.9.4)", "stestr (>=2.5.0)", "testscenarios (>=0.5.0)", "testtools (>=2.3.0)", "tomli (>=1.1.0)"] @@ -94,6 +93,18 @@ d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] +[[package]] +name = "cachetools" +version = "5.3.0" +description = "Extensible memoizing collections and decorators" +category = "dev" +optional = false +python-versions = "~=3.7" +files = [ + {file = "cachetools-5.3.0-py3-none-any.whl", hash = "sha256:429e1a1e845c008ea6c85aa35d4b98b65d6a9763eeef3e37e92728a12d1de9d4"}, + {file = "cachetools-5.3.0.tar.gz", hash = "sha256:13dfddc7b8df938c21a940dfa6557ce6e94a2f1cdfa58eb90c805721d58f2c14"}, +] + [[package]] name = "certifi" version = "2022.12.7" @@ -118,6 +129,18 @@ files = [ {file = "cfgv-3.3.1.tar.gz", hash = "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"}, ] +[[package]] +name = "chardet" +version = "5.1.0" +description = "Universal encoding detector for Python 3" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "chardet-5.1.0-py3-none-any.whl", hash = "sha256:362777fb014af596ad31334fde1e8c327dfdb076e1960d1694662d46a6917ab9"}, + {file = "chardet-5.1.0.tar.gz", hash = "sha256:0d62712b956bc154f85fb0a266e2a3c5913c2967e00348701b32411d6def31e5"}, +] + [[package]] name = "charset-normalizer" version = "3.1.0" @@ -275,20 +298,20 @@ testing = ["covdefaults (>=2.3)", "coverage (>=7.2.1)", "pytest (>=7.2.2)", "pyt [[package]] name = "flake8" -version = "6.0.0" +version = "5.0.4" description = "the modular source code checker: pep8 pyflakes and co" category = "dev" optional = false -python-versions = ">=3.8.1" +python-versions = ">=3.6.1" files = [ - {file = "flake8-6.0.0-py2.py3-none-any.whl", hash = "sha256:3833794e27ff64ea4e9cf5d410082a8b97ff1a06c16aa3d2027339cd0f1195c7"}, - {file = "flake8-6.0.0.tar.gz", hash = "sha256:c61007e76655af75e6785a931f452915b371dc48f56efd765247c8fe68f2b181"}, + {file = "flake8-5.0.4-py2.py3-none-any.whl", hash = "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"}, + {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, ] [package.dependencies] mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.10.0,<2.11.0" -pyflakes = ">=3.0.0,<3.1.0" +pycodestyle = ">=2.9.0,<2.10.0" +pyflakes = ">=2.5.0,<2.6.0" [[package]] name = "flake8-docstrings" @@ -401,14 +424,14 @@ files = [ [[package]] name = "importlib-metadata" -version = "6.0.0" +version = "6.1.0" description = "Read metadata from Python packages" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "importlib_metadata-6.0.0-py3-none-any.whl", hash = "sha256:7efb448ec9a5e313a57655d35aa54cd3e01b7e1fbcf72dce1bf06119420f5bad"}, - {file = "importlib_metadata-6.0.0.tar.gz", hash = "sha256:e354bedeb60efa6affdcc8ae121b73544a7aa74156d047311948f6d711cd378d"}, + {file = "importlib_metadata-6.1.0-py3-none-any.whl", hash = "sha256:ff80f3b5394912eb1b108fcfd444dc78b7f1f3e16b16188054bd01cb9cb86f09"}, + {file = "importlib_metadata-6.1.0.tar.gz", hash = "sha256:43ce9281e097583d758c2c708c4376371261a02c34682491a8e98352365aad20"}, ] [package.dependencies] @@ -431,6 +454,24 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "isort" +version = "5.12.0" +description = "A Python utility / library to sort Python imports." +category = "dev" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.12.0-py3-none-any.whl", hash = "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6"}, + {file = "isort-5.12.0.tar.gz", hash = "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504"}, +] + +[package.extras] +colors = ["colorama (>=0.4.3)"] +pipfile-deprecated-finder = ["pip-shims (>=0.5.2)", "pipreqs", "requirementslib"] +plugins = ["setuptools"] +requirements-deprecated-finder = ["pip-api", "pipreqs"] + [[package]] name = "jinja2" version = "3.1.2" @@ -826,14 +867,14 @@ virtualenv = ">=20.10.0" [[package]] name = "pycodestyle" -version = "2.10.0" +version = "2.9.1" description = "Python style guide checker" category = "dev" optional = false python-versions = ">=3.6" files = [ - {file = "pycodestyle-2.10.0-py2.py3-none-any.whl", hash = "sha256:8a4eaf0d0495c7395bdab3589ac2db602797d76207242c17d470186815706610"}, - {file = "pycodestyle-2.10.0.tar.gz", hash = "sha256:347187bdb476329d98f695c213d7295a846d1152ff4fe9bacb8a9590b8ee7053"}, + {file = "pycodestyle-2.9.1-py2.py3-none-any.whl", hash = "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"}, + {file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"}, ] [[package]] @@ -856,14 +897,14 @@ toml = ["tomli (>=1.2.3)"] [[package]] name = "pyflakes" -version = "3.0.1" +version = "2.5.0" description = "passive checker of Python programs" category = "dev" optional = false python-versions = ">=3.6" files = [ - {file = "pyflakes-3.0.1-py2.py3-none-any.whl", hash = "sha256:ec55bf7fe21fff7f1ad2f7da62363d749e2a470500eab1b555334b67aa1ef8cf"}, - {file = "pyflakes-3.0.1.tar.gz", hash = "sha256:ec8b276a6b60bd80defed25add7e439881c19e64850afd9b346283d4165fd0fd"}, + {file = "pyflakes-2.5.0-py2.py3-none-any.whl", hash = "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2"}, + {file = "pyflakes-2.5.0.tar.gz", hash = "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"}, ] [[package]] @@ -897,6 +938,26 @@ files = [ markdown = ">=3.2" pyyaml = "*" +[[package]] +name = "pyproject-api" +version = "1.5.1" +description = "API to interact with the python pyproject.toml based projects" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyproject_api-1.5.1-py3-none-any.whl", hash = "sha256:4698a3777c2e0f6b624f8a4599131e2a25376d90fe8d146d7ac74c67c6f97c43"}, + {file = "pyproject_api-1.5.1.tar.gz", hash = "sha256:435f46547a9ff22cf4208ee274fca3e2869aeb062a4834adfc99a4dd64af3cf9"}, +] + +[package.dependencies] +packaging = ">=23" +tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} + +[package.extras] +docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] +testing = ["covdefaults (>=2.2.2)", "importlib-metadata (>=6)", "pytest (>=7.2.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "virtualenv (>=20.17.1)", "wheel (>=0.38.4)"] + [[package]] name = "pyright" version = "1.1.299" @@ -1155,6 +1216,7 @@ files = [ [package.dependencies] markdown-it-py = ">=2.2.0,<3.0.0" pygments = ">=2.13.0,<3.0.0" +typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} [package.extras] jupyter = ["ipywidgets (>=7.5.1,<9)"] @@ -1239,6 +1301,34 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] +[[package]] +name = "tox" +version = "4.4.7" +description = "tox is a generic virtualenv management and test command line tool" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tox-4.4.7-py3-none-any.whl", hash = "sha256:da10ca1d809b99fae80b706b9dc9656b1daf505a395ac427d130a8a85502d08f"}, + {file = "tox-4.4.7.tar.gz", hash = "sha256:52c92a96e2c3fd47c5301e9c26f5a871466133d5376958c1ed95ef4ff4629cbe"}, +] + +[package.dependencies] +cachetools = ">=5.3" +chardet = ">=5.1" +colorama = ">=0.4.6" +filelock = ">=3.9" +packaging = ">=23" +platformdirs = ">=2.6.2" +pluggy = ">=1" +pyproject-api = ">=1.5" +tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} +virtualenv = ">=20.17.1" + +[package.extras] +docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-argparse-cli (>=1.11)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)", "sphinx-copybutton (>=0.5.1)", "sphinx-inline-tabs (>=2022.1.2b11)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] +testing = ["build[virtualenv] (>=0.10)", "covdefaults (>=2.2.2)", "devpi-process (>=0.3)", "diff-cover (>=7.4)", "distlib (>=0.3.6)", "flaky (>=3.7)", "hatch-vcs (>=0.3)", "hatchling (>=1.12.2)", "psutil (>=5.9.4)", "pytest (>=7.2.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-xdist (>=3.1)", "re-assert (>=1.1)", "time-machine (>=2.9)", "wheel (>=0.38.4)"] + [[package]] name = "typing-extensions" version = "4.5.0" @@ -1348,5 +1438,5 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" -python-versions = "^3.9" -content-hash = "3d0d330e676d623b065cd7111aa7bc28a4dd44c7bba6f97938d7e54009546193" +python-versions = "^3.8" +content-hash = "0d3d02b694099f712d6ebec660a6854bca91b1ebebad0f81be5805b1974c9923" diff --git a/pyproject.toml b/pyproject.toml index 8d74adbc..22794f5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,43 +9,46 @@ repository = "https://github.com/python-validators/validators" keywords = ["validation", "validator", "python-validator"] classifiers = [ "Development Status :: 4 - Beta", - 'Environment :: Web Environment', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3 :: Only', + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', - 'Topic :: Software Development :: Libraries :: Python Modules', + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Software Development :: Libraries :: Python Modules", ] +include = ["CHANGES.md", "docs/*"] [tool.poetry.dependencies] -python = "^3.9" +python = "^3.8" [tool.poetry.group.dev.dependencies] -black = "^23.1.0" -flake8 = "^6.0.0" -flake8-docstrings = "^1.7.0" -pre-commit = "^3.1.1" -pyright = "^1.1.293" -setuptools = "^67.2.0" - -[tool.poetry.group.tests.dependencies] -pytest = "^7.2.2" - -[tool.poetry.group.sast.dependencies] -bandit = { extras = ["toml"], version = "^1.7.4" } +pre-commit = "^3.2.0" +tox = "^4.4.7" [tool.poetry.group.docs.dependencies] mkdocs = "^1.4.2" -mkdocs-material = "^9.1.1" +mkdocs-material = "^9.1.3" mkdocstrings = { extras = ["python"], version = "^0.20.0" } +[tool.poetry.group.sast.dependencies] +bandit = "^1.7.5" + +[tool.poetry.group.tests.dependencies] +pytest = "^7.2.2" + +[tool.poetry.group.type-lint-fmt.dependencies] +black = "^23.1.0" +flake8 = "^5.0.4" +flake8-docstrings = "^1.7.0" +isort = "^5.12.0" +pyright = "^1.1.299" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" @@ -56,17 +59,49 @@ build-backend = "poetry.core.masonry.api" [tool.black] line-length = 100 -target-version = ['py39', 'py310', 'py311'] +target-version = ["py38", "py39", "py310", "py311"] [tool.bandit] -exclude_dirs = [".github", ".pytest_cache", ".tox", ".vscode", "tests", "docs"] +exclude_dirs = [ + ".github", + ".pytest_cache", + ".tox", + ".vscode", + "docs", + "site", + "tests", +] + +[tool.isort] +extend_skip_glob = ["**/i18n/*"] +ensure_newline_before_comments = true +force_grid_wrap = 0 +force_sort_within_sections = true +ignore_comments = true +include_trailing_comma = true +known_local_folder = ["validators"] +line_length = 100 +length_sort = true +multi_line_output = 3 +profile = "black" +reverse_sort = true +reverse_relative = true +skip_gitignore = true +use_parentheses = true + +[tool.pyright] +include = ["validators", "tests"] +exclude = ["**/__pycache__", ".pytest_cache/", ".tox/", "site/"] +pythonVersion = "3.8" +pythonPlatform = "All" +typeCheckingMode = "strict" [tool.tox] -legacy_tox_ini = ''' +legacy_tox_ini = """ [tox] requires = tox >= 4.0 - env_list = py{39,310,311} + env_list = py{38,39,310,311} # format, lint, type, [testenv] @@ -88,4 +123,4 @@ legacy_tox_ini = ''' # description = run type checker # deps = pyright # commands = pyright -''' +""" diff --git a/setup.cfg b/setup.cfg index 972ca226..038b70ab 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,13 +1,5 @@ -# only until: https://github.com/PyCQA/flake8/issues/234 -# consider prospector instead? +# until https://github.com/PyCQA/flake8/issues/234 is resolved [flake8] max-line-length = 100 docstring-convention = google - -# [isort] -# known_first_party = sqlalchemy_utils,tests -# line_length = 100 -# multi_line_output = 3 -# not_skip = __init__.py -# order_by_type = false diff --git a/setup.py b/setup.py deleted file mode 100644 index adf03742..00000000 --- a/setup.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -""" -validators ----------- - -Python Data Validation for Humans™. -""" - -# standard -import pathlib -import sys -import os -import re - -# external -from setuptools import setup, find_packages - - -PY3 = sys.version_info[0] == 3 -HERE = os.path.dirname(os.path.abspath(__file__)) - - -def get_version(): - filename = os.path.join(HERE, "validators", "__init__.py") - contents = pathlib.Path(filename).read_text() - pattern = r"^__version__ = '(.*?)'$" - return matches[1] if (matches := re.search(pattern, contents, re.MULTILINE)) else "" - - -extras_require = { - "test": ["pytest>=2.2.3", "flake8>=2.4.0", "isort>=4.2.2"], -} - -install_requires = [ - "decorator>=3.4.0", -] - -setup( - name="validators", - version=get_version(), - url="https://github.com/kvesteri/validators", - license="MIT", - author="Konsta Vesterinen", - author_email="konsta@fastmonkeys.com", - description="Python Data Validation for Humans™.", - long_description=__doc__, - packages=find_packages(".", exclude=["tests", "tests.*"]), - zip_safe=False, - include_package_data=True, - platforms="any", - install_requires=install_requires, - build_requires=install_requires, - extras_require=extras_require, - classifiers=[ - "Environment :: Web Environment", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", - "Topic :: Software Development :: Libraries :: Python Modules", - ], - python_requires=">=3.4", -)