diff --git a/.coveragerc b/.coveragerc index 4d3ea06..b110d59 100644 --- a/.coveragerc +++ b/.coveragerc @@ -5,8 +5,6 @@ omit = src/tld/parsers/* .tox/* src_*/* - src_py27/* - src_py35/* relative_files = True diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52dc0bd..3f4d57e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,38 +28,6 @@ jobs: - name: Run pre-commit uses: pre-commit/action@v3.0.0 - # ************************************* - # ************* Python 3.6 ************ - # ************************************* - test-python-36: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - max-parallel: 5 - matrix: - include: - - python-version: '3.6' - tox_env: py36 - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install pip-tools - pip-compile requirements/testing.in - pip install -r requirements/testing.txt - - name: Run Tests - run: tox -e ${{ matrix.tox_env }} - - name: Coveralls - uses: AndreMiras/coveralls-python-action@develop - with: - parallel: true - flag-name: Run Tests - # ************************************* # ********** Python 3.7-3.11 ********** # ************************************* @@ -81,9 +49,9 @@ jobs: - python-version: '3.11' tox_env: py311 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4c7477c..648a0e2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,11 @@ are used for versioning (schema follows below): 0.3.4 to 0.4). - All backwards incompatible changes are mentioned in this document. +0.13 +---- + +- Drop Python 2.7, 3.5 and 3.6 support. Minimum required version now is Python 3.7. + 0.12.7 ------ 2023-02-01 diff --git a/README.rst b/README.rst index 38397c3..581f90c 100644 --- a/README.rst +++ b/README.rst @@ -33,9 +33,7 @@ Optionally raises exceptions on non-existing TLDs or silently fails (if Prerequisites ============= -- Python 3.6, 3.7, 3.8, 3.9, 3.10 or 3.11. - -`Support for Python 2.7 and 3.5`_ is available as well. +- Python 3.7, 3.8, 3.9, 3.10 or 3.11. Documentation ============= @@ -267,61 +265,6 @@ To free up memory occupied by loading of custom TLD names, use # Free resources occupied by the custom TLD names list reset_tld_names("tests/res/effective_tld_names_custom.dat.txt") -Support for Python 2.7 and 3.5 -============================== -As you might have noticed, typing (Python 3.6+) is extensively used in the code. -However, Python 3.5 will likely be supported until it's EOL. All modern recent -versions (starting from `tld` 0.11.7) are fully compatible with -Python 2.7 and 3.5 (just works with ``pip install tld``). - -**Install from pip** - -.. code-block:: sh - - pip install tld - -Development tips follow: - -Python 2.7 ----------- -**Install locally in development mode** - -.. code-block:: sh - - python setup.py develop --python-tag py27 - -**Prepare dist** - -.. code-block:: sh - - ./scripts/prepare_build_py27.sh - -**Run tests** - -.. code-block:: sh - - tox -e py27 - -Python 3.5 ----------- -**Install locally in development mode** - -.. code-block:: sh - - python setup.py develop --python-tag py35 - -**Prepare dist** - -.. code-block:: sh - - ./scripts/prepare_build_py35.sh - -**Run tests** - -.. code-block:: sh - - tox -e py35 - Troubleshooting =============== If somehow domain names listed `here `_ @@ -344,7 +287,7 @@ Simply type: .. code-block:: sh - ./runtests.py + pytest Or use tox: diff --git a/pyproject.toml b/pyproject.toml index a8c67f8..d47b465 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ [tool.black] line-length = 80 -target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311'] +target-version = ['py37', 'py38', 'py39', 'py310', 'py311'] include = '\.pyi?$' extend-exclude = ''' /( @@ -35,8 +35,8 @@ force_grid_wrap = 0 use_parentheses = true ensure_newline_before_comments = true line_length = 80 -known_first_party = "faker_file" -known_third_party = ["django", "factory"] +known_first_party = "tld" +known_third_party = ["faker"] skip = ["wsgi.py",] [tool.ruff] @@ -67,7 +67,6 @@ exclude = [ "dist", "node_modules", "venv", - "examples/django_example/project/wsgi.py", "examples/gae/data.py", ] per-file-ignores = {} diff --git a/pytest.ini b/pytest.ini index 0287e4e..d1a703b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -12,7 +12,7 @@ python_files = test.py test_*.py tests.py -python_paths = +pythonpath = src examples/gae addopts= diff --git a/requirements/bench.txt b/requirements/bench.txt index a6ffbf6..3a5da62 100644 --- a/requirements/bench.txt +++ b/requirements/bench.txt @@ -22,11 +22,11 @@ kiwisolver==1.4.4 # via matplotlib line-profiler==4.0.2 # via -r bench.in -matplotlib==3.6.3 +matplotlib==3.7.0 # via -r bench.in memory-profiler==0.61.0 # via -r bench.in -numpy==1.24.1 +numpy==1.24.2 # via # contourpy # matplotlib diff --git a/requirements/code_style.in b/requirements/code_style.in index 8ea1c7d..bcedeb3 100644 --- a/requirements/code_style.in +++ b/requirements/code_style.in @@ -1,10 +1,9 @@ # Style checkers +black +doc8 +isort +mypy +pre-commit #pydocstyle #pylint ruff -isort -pre-commit -mypy<=0.256; python_version <= '2.7' -mypy; python_version >= '2.7' -black -doc8 diff --git a/requirements/code_style.txt b/requirements/code_style.txt index cbba5d6..0e03e20 100644 --- a/requirements/code_style.txt +++ b/requirements/code_style.txt @@ -4,7 +4,7 @@ # # pip-compile code_style.in # -black==22.12.0 +black==23.1.0 # via -r code_style.in cfgv==3.3.1 # via pre-commit @@ -20,27 +20,29 @@ docutils==0.19 # restructuredtext-lint filelock==3.9.0 # via virtualenv -identify==2.5.17 +identify==2.5.18 # via pre-commit isort==5.12.0 # via -r code_style.in -mypy==0.991 ; python_version >= "2.7" +mypy==1.0.1 # via -r code_style.in -mypy-extensions==0.4.3 +mypy-extensions==1.0.0 # via # black # mypy nodeenv==1.7.0 # via pre-commit +packaging==23.0 + # via black pathspec==0.11.0 # via black pbr==5.11.1 # via stevedore -platformdirs==2.6.2 +platformdirs==3.0.0 # via # black # virtualenv -pre-commit==3.0.2 +pre-commit==3.1.0 # via -r code_style.in pygments==2.14.0 # via doc8 @@ -48,18 +50,18 @@ pyyaml==6.0 # via pre-commit restructuredtext-lint==1.4.0 # via doc8 -ruff==0.0.238 +ruff==0.0.253 # via -r code_style.in -stevedore==4.1.1 +stevedore==5.0.0 # via doc8 tomli==2.0.1 # via # black # doc8 # mypy -typing-extensions==4.4.0 +typing-extensions==4.5.0 # via mypy -virtualenv==20.17.1 +virtualenv==20.19.0 # via pre-commit # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/debug.txt b/requirements/debug.txt index db7386e..1a5ec30 100644 --- a/requirements/debug.txt +++ b/requirements/debug.txt @@ -16,7 +16,7 @@ executing==1.2.0 # via stack-data ipdb==0.13.11 # via -r debug.in -ipython==8.9.0 +ipython==8.10.0 # via # -r debug.in # ipdb @@ -30,7 +30,7 @@ pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -prompt-toolkit==3.0.36 +prompt-toolkit==3.0.37 # via ipython ptyprocess==0.7.0 # via pexpect diff --git a/requirements/dev.txt b/requirements/dev.txt index 2698bea..d4b27e3 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -10,13 +10,11 @@ asttokens==2.2.1 # via stack-data attrs==22.2.0 # via pytest -autopep8==2.0.1 - # via py-backwards babel==2.11.0 # via sphinx backcall==0.2.0 # via ipython -black==22.12.0 +black==23.1.0 # via -r code_style.in bleach==6.0.0 # via readme-renderer @@ -35,16 +33,14 @@ charset-normalizer==3.0.1 click==8.1.3 # via black colorama==0.4.6 - # via - # py-backwards - # tox + # via tox contourpy==1.0.7 # via matplotlib -coverage[toml]==7.1.0 ; python_version >= "3.7" +coverage[toml]==7.2.1 # via # -r test.in # pytest-cov -cryptography==39.0.0 +cryptography==39.0.1 # via secretstorage cycler==0.11.0 # via matplotlib @@ -62,11 +58,13 @@ docutils==0.19 # readme-renderer # restructuredtext-lint # sphinx +exceptiongroup==1.1.0 + # via pytest executing==1.2.0 # via stack-data -factory-boy==3.2.1 ; python_version >= "3.7" +factory-boy==3.2.1 # via -r test.in -faker==16.6.1 ; python_version >= "3.7" +faker==17.3.0 # via # -r test.in # factory-boy @@ -78,7 +76,7 @@ fonttools==4.38.0 # via matplotlib gprof2dot==2022.7.29 # via pytest-profiling -identify==2.5.17 +identify==2.5.18 # via pre-commit idna==3.4 # via requests @@ -92,7 +90,7 @@ iniconfig==2.0.0 # via pytest ipdb==0.13.11 # via -r debug.in -ipython==8.9.0 +ipython==8.10.0 # via # -r debug.in # ipdb @@ -114,11 +112,11 @@ kiwisolver==1.4.4 # via matplotlib line-profiler==4.0.2 # via -r bench.in -markdown-it-py==2.1.0 +markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 # via jinja2 -matplotlib==3.6.3 +matplotlib==3.7.0 # via -r bench.in matplotlib-inline==0.1.6 # via ipython @@ -126,22 +124,23 @@ mdurl==0.1.2 # via markdown-it-py memory-profiler==0.61.0 # via -r bench.in -more-itertools==9.0.0 +more-itertools==9.1.0 # via jaraco-classes -mypy==0.991 ; python_version >= "2.7" +mypy==1.0.1 # via -r code_style.in -mypy-extensions==0.4.3 +mypy-extensions==1.0.0 # via # black # mypy nodeenv==1.7.0 # via pre-commit -numpy==1.24.1 +numpy==1.24.2 # via # contourpy # matplotlib packaging==23.0 # via + # black # matplotlib # pyproject-api # pytest @@ -161,7 +160,7 @@ pillow==9.4.0 # via matplotlib pkginfo==1.9.6 # via twine -platformdirs==2.6.2 +platformdirs==3.0.0 # via # black # tox @@ -170,9 +169,9 @@ pluggy==1.0.0 # via # pytest # tox -pre-commit==3.0.2 +pre-commit==3.1.0 # via -r code_style.in -prompt-toolkit==3.0.36 +prompt-toolkit==3.0.37 # via ipython psutil==5.9.4 # via memory-profiler @@ -180,20 +179,10 @@ ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data -py==1.11.0 - # via - # -r test.in - # pytest -py-backwards==0.7 - # via -r release.in -py-backwards-astunparse==1.5.0.post3 - # via py-backwards py-spy==0.3.14 # via -r bench.in pycallgraph2==1.1.3 # via -r bench.in -pycodestyle==2.10.0 - # via autopep8 pycparser==2.21 # via cffi pygments==2.14.0 @@ -209,21 +198,18 @@ pyprof2calltree==1.4.5 # via -r bench.in pyproject-api==1.5.0 # via tox -pytest==6.2.5 ; python_version >= "3.7" +pytest==7.2.1 # via # -r test.in # pytest-cov # pytest-ordering # pytest-profiling - # pytest-pythonpath -pytest-cov==4.0.0 ; python_version >= "3.7" +pytest-cov==4.0.0 # via -r test.in -pytest-ordering==0.6 ; python_version >= "3.7" +pytest-ordering==0.6 # via -r test.in pytest-profiling==1.7.0 # via -r bench.in -pytest-pythonpath==0.7.4 - # via -r test.in python-dateutil==2.8.2 # via # faker @@ -247,7 +233,7 @@ rfc3986==2.0.0 # via twine rich==13.3.1 # via twine -ruff==0.0.238 +ruff==0.0.253 # via -r code_style.in secretstorage==3.3.3 # via keyring @@ -255,7 +241,6 @@ six==1.16.0 # via # asttokens # bleach - # py-backwards-astunparse # pytest-profiling # python-dateutil snowballstemmer==2.2.0 @@ -278,21 +263,19 @@ stack-data==0.6.2 # via ipython stdeb==0.10.0 # via -r build.in -stevedore==4.1.1 +stevedore==5.0.0 # via doc8 -toml==0.10.2 - # via pytest tomli==2.0.1 # via - # autopep8 # black # coverage # doc8 # ipdb # mypy # pyproject-api + # pytest # tox -tox==4.4.4 ; python_version >= "3.7" +tox==4.4.6 # via -r test.in traitlets==5.9.0 # via @@ -300,17 +283,13 @@ traitlets==5.9.0 # matplotlib-inline twine==4.0.2 # via -r release.in -typed-ast==1.5.4 - # via - # py-backwards - # py-backwards-astunparse -typing-extensions==4.4.0 +typing-extensions==4.5.0 # via mypy urllib3==1.26.14 # via # requests # twine -virtualenv==20.17.1 +virtualenv==20.19.0 # via # pre-commit # tox @@ -318,9 +297,7 @@ wcwidth==0.2.6 # via prompt-toolkit webencodings==0.5.1 # via bleach -wheel==0.38.4 - # via py-backwards-astunparse -zipp==3.12.0 +zipp==3.15.0 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/release.in b/requirements/release.in index dc8c29e..af996cf 100644 --- a/requirements/release.in +++ b/requirements/release.in @@ -1,23 +1 @@ -# py2.7, py3.5, py3.6 -autopep8==1.5.7; python_version < '3.7' -bleach==3.3.0; python_version < '3.7' -colorama==0.4.4; python_version < '3.7' -docutils==0.17.1; python_version < '3.7' -importlib-metadata==4.5.0; python_version < '3.7' -jeepney==0.6.0; python_version < '3.7' -keyring==23.0.1; python_version < '3.7' -py-backwards-astunparse==1.5.0.post3; python_version < '3.7' -py-backwards==0.7; python_version < '3.7' -pygments==2.9.0; python_version < '3.7' -readme-renderer==29.0; python_version < '3.7' -requests==2.25.1; python_version < '3.7' -rfc3986==1.5.0; python_version < '3.7' -secretstorage==3.3.1; python_version < '3.7' -twine==3.4.1; python_version < '3.7' -typed-ast==1.4.3; python_version < '3.7' -wheel==0.36.2; python_version < '3.7' -zipp==3.4.1; python_version < '3.7' - -# >=py3.7 twine -py-backwards diff --git a/requirements/release.txt b/requirements/release.txt index c033ecf..7159cfd 100644 --- a/requirements/release.txt +++ b/requirements/release.txt @@ -4,8 +4,6 @@ # # pip-compile release.in # -autopep8==2.0.1 - # via py-backwards bleach==6.0.0 # via readme-renderer certifi==2022.12.7 @@ -14,9 +12,7 @@ cffi==1.15.1 # via cryptography charset-normalizer==3.0.1 # via requests -colorama==0.4.6 - # via py-backwards -cryptography==39.0.0 +cryptography==39.0.1 # via secretstorage docutils==0.19 # via readme-renderer @@ -34,20 +30,14 @@ jeepney==0.8.0 # secretstorage keyring==23.13.1 # via twine -markdown-it-py==2.1.0 +markdown-it-py==2.2.0 # via rich mdurl==0.1.2 # via markdown-it-py -more-itertools==9.0.0 +more-itertools==9.1.0 # via jaraco-classes pkginfo==1.9.6 # via twine -py-backwards==0.7 - # via -r release.in -py-backwards-astunparse==1.5.0.post3 - # via py-backwards -pycodestyle==2.10.0 - # via autopep8 pycparser==2.21 # via cffi pygments==2.14.0 @@ -69,24 +59,14 @@ rich==13.3.1 secretstorage==3.3.3 # via keyring six==1.16.0 - # via - # bleach - # py-backwards-astunparse -tomli==2.0.1 - # via autopep8 + # via bleach twine==4.0.2 # via -r release.in -typed-ast==1.5.4 - # via - # py-backwards - # py-backwards-astunparse urllib3==1.26.14 # via # requests # twine webencodings==0.5.1 # via bleach -wheel==0.38.4 - # via py-backwards-astunparse -zipp==3.12.0 +zipp==3.15.0 # via importlib-metadata diff --git a/requirements/test.in b/requirements/test.in index 5db31ee..67d615e 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -1,30 +1,7 @@ -# py2.7, py3.5, py3.6 -Faker==8.1.4; python_version < '3.7' -bleach==3.3.0; python_version < '3.7' -colorama==0.4.4; python_version < '3.7' -coverage>=4.5.4,<5.6; python_version < '3.7' -docutils==0.17.1; python_version < '3.7' -factory_boy==2.11.1; python_version < '3.7' -filelock==3.0.12; python_version < '3.7' -iniconfig==1.1.1; python_version < '3.7' -packaging==20.9; python_version < '3.7' -pytest-cov==2.12.0; python_version < '3.7' -pytest-ordering==0.6; python_version < '3.7' -pytest==6.2.4; python_version < '3.7' -rfc3986==1.5.0; python_version < '3.7' -tox==3.23.1; python_version < '3.7' -twine==3.4.1; python_version < '3.7' -virtualenv==20.4.7; python_version < '3.7' - -# >=py3.7 -Faker; python_version >= '3.7' -coverage; python_version >= '3.7' -factory_boy; python_version >= '3.7' -pytest-cov; python_version >= '3.7' -pytest-ordering; python_version >= '3.7' -pytest<7.0; python_version >= '3.7' -tox; python_version >= '3.7' - -# indi -py -pytest-pythonpath +Faker +coverage +factory_boy +pytest +pytest-cov +pytest-ordering +tox diff --git a/requirements/test.txt b/requirements/test.txt index 21b1565..90eea27 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -12,15 +12,17 @@ chardet==5.1.0 # via tox colorama==0.4.6 # via tox -coverage[toml]==7.1.0 ; python_version >= "3.7" +coverage[toml]==7.2.1 # via # -r test.in # pytest-cov distlib==0.3.6 # via virtualenv -factory-boy==3.2.1 ; python_version >= "3.7" +exceptiongroup==1.1.0 + # via pytest +factory-boy==3.2.1 # via -r test.in -faker==16.6.1 ; python_version >= "3.7" +faker==17.3.0 # via # -r test.in # factory-boy @@ -35,7 +37,7 @@ packaging==23.0 # pyproject-api # pytest # tox -platformdirs==2.6.2 +platformdirs==3.0.0 # via # tox # virtualenv @@ -43,36 +45,28 @@ pluggy==1.0.0 # via # pytest # tox -py==1.11.0 - # via - # -r test.in - # pytest pyproject-api==1.5.0 # via tox -pytest==6.2.5 ; python_version >= "3.7" +pytest==7.2.1 # via # -r test.in # pytest-cov # pytest-ordering - # pytest-pythonpath -pytest-cov==4.0.0 ; python_version >= "3.7" +pytest-cov==4.0.0 # via -r test.in -pytest-ordering==0.6 ; python_version >= "3.7" - # via -r test.in -pytest-pythonpath==0.7.4 +pytest-ordering==0.6 # via -r test.in python-dateutil==2.8.2 # via faker six==1.16.0 # via python-dateutil -toml==0.10.2 - # via pytest tomli==2.0.1 # via # coverage # pyproject-api + # pytest # tox -tox==4.4.4 ; python_version >= "3.7" +tox==4.4.6 # via -r test.in -virtualenv==20.17.1 +virtualenv==20.19.0 # via tox diff --git a/requirements/test_py27.txt b/requirements/test_py27.txt deleted file mode 100644 index 0503c2d..0000000 --- a/requirements/test_py27.txt +++ /dev/null @@ -1,6 +0,0 @@ -coverage==4.5.3 -factory_boy==2.11.1 -Faker==1.0.4 -pytest-cov==2.6.1 -pytest==4.4.0 -tox==3.8.6 diff --git a/requirements/testing.txt b/requirements/testing.txt index afa6c90..cd40463 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -12,15 +12,17 @@ chardet==5.1.0 # via tox colorama==0.4.6 # via tox -coverage[toml]==7.1.0 ; python_version >= "3.7" +coverage[toml]==7.2.1 # via # -r test.in # pytest-cov distlib==0.3.6 # via virtualenv -factory-boy==3.2.1 ; python_version >= "3.7" +exceptiongroup==1.1.0 + # via pytest +factory-boy==3.2.1 # via -r test.in -faker==16.6.1 ; python_version >= "3.7" +faker==17.3.0 # via # -r test.in # factory-boy @@ -35,7 +37,7 @@ packaging==23.0 # pyproject-api # pytest # tox -platformdirs==2.6.2 +platformdirs==3.0.0 # via # tox # virtualenv @@ -43,36 +45,28 @@ pluggy==1.0.0 # via # pytest # tox -py==1.11.0 - # via - # -r test.in - # pytest pyproject-api==1.5.0 # via tox -pytest==6.2.5 ; python_version >= "3.7" +pytest==7.2.1 # via # -r test.in # pytest-cov # pytest-ordering - # pytest-pythonpath -pytest-cov==4.0.0 ; python_version >= "3.7" +pytest-cov==4.0.0 # via -r test.in -pytest-ordering==0.6 ; python_version >= "3.7" - # via -r test.in -pytest-pythonpath==0.7.4 +pytest-ordering==0.6 # via -r test.in python-dateutil==2.8.2 # via faker six==1.16.0 # via python-dateutil -toml==0.10.2 - # via pytest tomli==2.0.1 # via # coverage # pyproject-api + # pytest # tox -tox==4.4.4 ; python_version >= "3.7" +tox==4.4.6 # via -r test.in -virtualenv==20.17.1 +virtualenv==20.19.0 # via tox diff --git a/runtests.py b/runtests.py index 5b54cd4..62f5b59 100755 --- a/runtests.py +++ b/runtests.py @@ -6,16 +6,6 @@ py_package_dir = "src" -try: - if os.environ.get("PYTHON_TAG") == "py35": - py_package_dir = "src_py35" - elif os.environ.get("PYTHON_TAG") == "py27": - py_package_dir = "src_py27" -except Exception: - pass - -# sys.argv.append(py_package_dir) - try: profile # noqa except Exception: @@ -31,7 +21,7 @@ def wrapped(*args, **kwargs): @profile def main(): - sys.path.insert(0, os.path.abspath(py_package_dir)) + sys.path.insert(0, os.path.abspath("src")) return pytest.main() diff --git a/scripts/build_deb_package_py27.sh b/scripts/build_deb_package_py27.sh deleted file mode 100755 index d91e974..0000000 --- a/scripts/build_deb_package_py27.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -version="" - -if [[ $1 == "--version" ]] -then - version="$2" - shift - shift - args="$@" -else - echo "You should provide a --version argument." -fi - -if [[ $version ]] -then - ./scripts/prepare_build_py27.sh --keep-tar-gz - py2dsc-deb "dist_py27/tld-$version.tar.gz" -fi diff --git a/scripts/build_deb_package_py35.sh b/scripts/build_deb_package_py35.sh deleted file mode 100755 index c830d2e..0000000 --- a/scripts/build_deb_package_py35.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -version="" - -if [[ $1 == "--version" ]] -then - version="$2" - shift - shift - args="$@" -else - echo "You should provide a --version argument." -fi - -if [[ $version ]] -then -# python setup.py sdist bdist_wheel - py2dsc-deb "dist_py35/tld-$version.tar.gz" -fi diff --git a/scripts/make_all_releases.sh b/scripts/make_all_releases.sh deleted file mode 100755 index 74b62c2..0000000 --- a/scripts/make_all_releases.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -./scripts/make_release.sh -./scripts/make_release_py35.sh -./scripts/make_release_py27.sh diff --git a/scripts/make_release.sh b/scripts/make_release.sh index c037a9d..ec79d4f 100755 --- a/scripts/make_release.sh +++ b/scripts/make_release.sh @@ -1,4 +1,3 @@ #!/usr/bin/env bash -#./scripts/prepare_build.sh -#python setup.py register -twine upload dist/* +python setup.py sdist bdist_wheel +twine upload dist/* --verbose diff --git a/scripts/make_release_py27.sh b/scripts/make_release_py27.sh deleted file mode 100755 index fc8fa56..0000000 --- a/scripts/make_release_py27.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -#./scripts/prepare_build_py27.sh -twine upload dist_py27/* diff --git a/scripts/make_release_py35.sh b/scripts/make_release_py35.sh deleted file mode 100755 index f12792f..0000000 --- a/scripts/make_release_py35.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -#./scripts/prepare_build_py35.sh -twine upload dist_py35/* diff --git a/scripts/prepare_all_builds.sh b/scripts/prepare_all_builds.sh deleted file mode 100755 index 5f5578b..0000000 --- a/scripts/prepare_all_builds.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -./scripts/prepare_build_py27.sh -./scripts/prepare_build_py35.sh -./scripts/prepare_build.sh diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh deleted file mode 100755 index 8c10ce8..0000000 --- a/scripts/prepare_build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -./scripts/uninstall.sh -./scripts/clean_up.sh -python setup.py sdist bdist_wheel --python-tag py36 -python setup.py sdist bdist_wheel --python-tag py37 -python setup.py sdist bdist_wheel --python-tag py38 -python setup.py sdist bdist_wheel --python-tag py39 -python setup.py sdist bdist_wheel --python-tag py310 -python setup.py sdist bdist_wheel --python-tag py311 diff --git a/scripts/prepare_build_py27.sh b/scripts/prepare_build_py27.sh deleted file mode 100755 index 0f4cc35..0000000 --- a/scripts/prepare_build_py27.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -./scripts/uninstall.sh -./scripts/clean_up.sh -rm -rf src_py27/ -cp -R src/ src_py27/ -py-backwards -i src/ -o src_py27/ -t 2.7 -d -cp -R src/tld/res/ src_py27/tld/ -sed -i '' -e 's/from functools import lru_cache/from backports.functools_lru_cache import lru_cache/g' $(find src_py27 -type f) -sed -i '' -e "s/= type(u'/= type('/g" $(find src_py27 -type f) -sed -i '' -e "s/=u'/='/g" $(find src_py27 -type f) -sed -i '' -e "s/u'uid/'uid/g" $(find src_py27 -type f) -sed -i '' -e "s/u'source/'source/g" $(find src_py27 -type f) -sed -i '' -e "s/u'local/'local/g" $(find src_py27 -type f) -sed -i '1i# -*- coding: utf-8 -*-' src_py27/tld/*.py -sed -i '1i# -*- coding: utf-8 -*-' src_py27/tld/tests/*.py -sed -i '' -e "s/from __future__ import unicode_literals//g" src_py27/tld/tests/test_core.py -sed -i '' -e "s/with self.subTest(.*):/if True:/g" $(find src_py27 -type f) - -python setup.py sdist bdist_wheel --python-tag py27 -rm -rf dist_py27/ -mv dist/ dist_py27/ - -if [[ $1 == "--keep-tar-gz" ]] -then - shift -else - rm dist_py27/*.tar.gz -fi diff --git a/scripts/prepare_build_py35.sh b/scripts/prepare_build_py35.sh deleted file mode 100755 index d0dd43c..0000000 --- a/scripts/prepare_build_py35.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -./scripts/uninstall.sh -./scripts/clean_up.sh -rm -rf src_py35/ -cp -R src/ src_py35/ -py-backwards -i src/ -o src_py35/ -t 2.7 -d -sed -i '' -e 's/unicode(/str(/g' $(find src_py35 -type f) -python setup.py sdist bdist_wheel --python-tag py35 -rm -rf dist_py35/ -mv dist/ dist_py35/ - -if [[ $1 == "--keep-tar-gz" ]] -then - shift -else - rm dist_py35/*.tar.gz -fi diff --git a/setup.cfg b/setup.cfg index b2cea30..980a824 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,8 @@ -;[bdist_wheel] -;universal = 1 +[bdist_wheel] +universal = 1 -;[wheel] -;universal = 1 +[wheel] +universal = 1 [metadata] license-file = LICENSE_LGPL_2.1.txt diff --git a/setup.py b/setup.py index 8b45aa0..8905a4d 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ import os -import sys from setuptools import find_packages, setup @@ -8,31 +7,7 @@ except Exception: readme = "" -version = "0.12.7" - -py_where = "./src" -py_package_dir = "src" -try: - if sys.argv[-2] == "--python-tag": - # For Python 3.5 - if sys.argv[-1] == "py35": - py_where = "./src_py35" - py_package_dir = "src_py35" - - # For Python 2.7 - elif sys.argv[-1] == "py27": - py_where = "./src_py27" - py_package_dir = "src_py27" - - # For development mode - if sys.argv[1] in ( - "develop", - "install", - ): - sys.argv.pop(-1) - sys.argv.pop(-1) -except Exception: - pass +version = "0.13" setup( name="tld", @@ -41,11 +16,7 @@ long_description=readme, classifiers=[ "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -67,23 +38,19 @@ "Source Code": "https://github.com/barseghyanartur/tld/", "Changelog": "https://tld.readthedocs.io/en/latest/changelog.html", }, - python_requires=">=2.7, <4", + python_requires=">=3.7, <4", keywords="tld, top-level domain names, python", author="Artur Barseghyan", author_email="artur.barseghyan@gmail.com", url="https://github.com/barseghyanartur/tld", - package_dir={"": py_package_dir}, - packages=find_packages(where=py_where), + package_dir={"": "src"}, + packages=find_packages(where="./src"), entry_points={ "console_scripts": ["update-tld-names = tld.utils:update_tld_names_cli"] }, include_package_data=True, license="MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-or-later", - install_requires=[ - 'six;python_version<="3.5"', # Used in Python 2.7 and 3.5 dist - 'typing;python_version<"3.5"', # Used in Python < 3.5 dist - 'backports.functools-lru-cache;python_version<"3.5"', # For Python 2.7 - ], + install_requires=[], test_suite="tld.tests", tests_require=[ "coverage", diff --git a/src/tld/__init__.py b/src/tld/__init__.py index da56c13..038a3d7 100644 --- a/src/tld/__init__.py +++ b/src/tld/__init__.py @@ -9,7 +9,7 @@ ) __title__ = "tld" -__version__ = "0.12.7" +__version__ = "0.13" __author__ = "Artur Barseghyan" __copyright__ = "2013-2023 Artur Barseghyan" __license__ = "MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-or-later" diff --git a/src/tld/res/effective_tld_names.dat.txt b/src/tld/res/effective_tld_names.dat.txt index 543eee0..c1ce374 100644 --- a/src/tld/res/effective_tld_names.dat.txt +++ b/src/tld/res/effective_tld_names.dat.txt @@ -7189,7 +7189,7 @@ org.zw // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-01-30T09:23:24Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-02-22T15:15:03Z // This list is auto-generated, don't edit it manually. // aaa : 2015-02-26 American Automobile Association, Inc. aaa @@ -8388,7 +8388,7 @@ glass // gle : 2014-07-24 Charleston Road Registry Inc. gle -// global : 2014-04-17 Dot Global Domain Registry Limited +// global : 2014-04-17 Identity Digital Limited global // globo : 2013-12-19 Globo Comunicação e Participações S.A @@ -9471,7 +9471,7 @@ pub // pwc : 2015-10-29 PricewaterhouseCoopers LLP pwc -// qpon : 2013-11-14 dotCOOL, Inc. +// qpon : 2013-11-14 dotQPON LLC qpon // quebec : 2013-12-19 PointQuébec Inc @@ -10677,6 +10677,11 @@ adobeaemcloud.net hlx.page hlx3.page +// Adobe Developer Platform : https://developer.adobe.com +// Submitted by Jesse MacFadyen +adobeio-static.net +adobeioruntime.net + // Agnat sp. z o.o. : https://domena.pl // Submitted by Przemyslaw Plewa beep.pl @@ -10691,6 +10696,24 @@ airkitapps.eu // Submitted by Etienne Stalmans aivencloud.com +// Akamai : https://www.akamai.com/ +// Submitted by Akamai Team +akadns.net +akamai.net +akamai-staging.net +akamaiedge.net +akamaiedge-staging.net +akamaihd.net +akamaihd-staging.net +akamaiorigin.net +akamaiorigin-staging.net +akamaized.net +akamaized-staging.net +edgekey.net +edgekey-staging.net +edgesuite.net +edgesuite-staging.net + // alboto.ca : http://alboto.ca // Submitted by Anton Avramov barsy.ca @@ -10935,6 +10958,10 @@ cdn.prod.atlassian-dev.net // Submitted by Lukas Reschke translated.page +// Autocode : https://autocode.com +// Submitted by Jacob Lee +autocode.dev + // AVM : https://avm.de // Submitted by Andreas Weise myfritz.net @@ -11063,6 +11090,11 @@ cafjs.com // Submitted by Marcus Popp mycd.eu +// Canva Pty Ltd : https://canva.com/ +// Submitted by Joel Aquilina +canva-apps.cn +canva-apps.com + // Carrd : https://carrd.co // Submitted by AJ drr.ac @@ -11980,6 +12012,7 @@ u.channelsdvr.net // Fastly Inc. : http://www.fastly.com/ // Submitted by Fastly Security edgecompute.app +fastly-edge.com fastly-terrarium.com fastlylb.net map.fastlylb.net @@ -12952,6 +12985,7 @@ cloudapp.net azurestaticapps.net 1.azurestaticapps.net 2.azurestaticapps.net +3.azurestaticapps.net centralus.azurestaticapps.net eastasia.azurestaticapps.net eastus2.azurestaticapps.net @@ -13538,6 +13572,56 @@ rocky.page спб.рус я.рус +// SAKURA Internet Inc. : https://www.sakura.ad.jp/ +// Submitted by Internet Service Department +180r.com +dojin.com +sakuratan.com +sakuraweb.com +x0.com +2-d.jp +bona.jp +crap.jp +daynight.jp +eek.jp +flop.jp +halfmoon.jp +jeez.jp +matrix.jp +mimoza.jp +ivory.ne.jp +mail-box.ne.jp +mints.ne.jp +mokuren.ne.jp +opal.ne.jp +sakura.ne.jp +sumomo.ne.jp +topaz.ne.jp +netgamers.jp +nyanta.jp +o0o0.jp +rdy.jp +rgr.jp +rulez.jp +s3.isk01.sakurastorage.jp +s3.isk02.sakurastorage.jp +saloon.jp +sblo.jp +skr.jp +tank.jp +uh-oh.jp +undo.jp +rs.webaccel.jp +user.webaccel.jp +websozai.jp +xii.jp +squares.net +jpn.org +kirara.st +x0.to +from.tv +sakura.tv + // Salesforce.com, Inc. https://salesforce.com/ // Submitted by Michael Biven *.builder.code.com @@ -13690,6 +13774,9 @@ vp4.me // Snowflake Inc : https://www.snowflake.com/ // Submitted by Faith Olapade +snowflake.app +privatelink.snowflake.app +streamlit.app streamlitapp.com // Snowplow Analytics : https://snowplowanalytics.com/ @@ -13965,6 +14052,10 @@ hk.org ltd.hk inc.hk +// UK Intis Telecom LTD : https://it.com +// Submitted by ITComdomains +it.com + // UNIVERSAL DOMAIN REGISTRY : https://www.udr.org.yt/ // see also: whois -h whois.udr.org.yt help // Submitted by Atanunu Igbunuroghene diff --git a/src/tld/res/effective_tld_names_public_only.dat.txt b/src/tld/res/effective_tld_names_public_only.dat.txt index 543eee0..c1ce374 100644 --- a/src/tld/res/effective_tld_names_public_only.dat.txt +++ b/src/tld/res/effective_tld_names_public_only.dat.txt @@ -7189,7 +7189,7 @@ org.zw // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-01-30T09:23:24Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2023-02-22T15:15:03Z // This list is auto-generated, don't edit it manually. // aaa : 2015-02-26 American Automobile Association, Inc. aaa @@ -8388,7 +8388,7 @@ glass // gle : 2014-07-24 Charleston Road Registry Inc. gle -// global : 2014-04-17 Dot Global Domain Registry Limited +// global : 2014-04-17 Identity Digital Limited global // globo : 2013-12-19 Globo Comunicação e Participações S.A @@ -9471,7 +9471,7 @@ pub // pwc : 2015-10-29 PricewaterhouseCoopers LLP pwc -// qpon : 2013-11-14 dotCOOL, Inc. +// qpon : 2013-11-14 dotQPON LLC qpon // quebec : 2013-12-19 PointQuébec Inc @@ -10677,6 +10677,11 @@ adobeaemcloud.net hlx.page hlx3.page +// Adobe Developer Platform : https://developer.adobe.com +// Submitted by Jesse MacFadyen +adobeio-static.net +adobeioruntime.net + // Agnat sp. z o.o. : https://domena.pl // Submitted by Przemyslaw Plewa beep.pl @@ -10691,6 +10696,24 @@ airkitapps.eu // Submitted by Etienne Stalmans aivencloud.com +// Akamai : https://www.akamai.com/ +// Submitted by Akamai Team +akadns.net +akamai.net +akamai-staging.net +akamaiedge.net +akamaiedge-staging.net +akamaihd.net +akamaihd-staging.net +akamaiorigin.net +akamaiorigin-staging.net +akamaized.net +akamaized-staging.net +edgekey.net +edgekey-staging.net +edgesuite.net +edgesuite-staging.net + // alboto.ca : http://alboto.ca // Submitted by Anton Avramov barsy.ca @@ -10935,6 +10958,10 @@ cdn.prod.atlassian-dev.net // Submitted by Lukas Reschke translated.page +// Autocode : https://autocode.com +// Submitted by Jacob Lee +autocode.dev + // AVM : https://avm.de // Submitted by Andreas Weise myfritz.net @@ -11063,6 +11090,11 @@ cafjs.com // Submitted by Marcus Popp mycd.eu +// Canva Pty Ltd : https://canva.com/ +// Submitted by Joel Aquilina +canva-apps.cn +canva-apps.com + // Carrd : https://carrd.co // Submitted by AJ drr.ac @@ -11980,6 +12012,7 @@ u.channelsdvr.net // Fastly Inc. : http://www.fastly.com/ // Submitted by Fastly Security edgecompute.app +fastly-edge.com fastly-terrarium.com fastlylb.net map.fastlylb.net @@ -12952,6 +12985,7 @@ cloudapp.net azurestaticapps.net 1.azurestaticapps.net 2.azurestaticapps.net +3.azurestaticapps.net centralus.azurestaticapps.net eastasia.azurestaticapps.net eastus2.azurestaticapps.net @@ -13538,6 +13572,56 @@ rocky.page спб.рус я.рус +// SAKURA Internet Inc. : https://www.sakura.ad.jp/ +// Submitted by Internet Service Department +180r.com +dojin.com +sakuratan.com +sakuraweb.com +x0.com +2-d.jp +bona.jp +crap.jp +daynight.jp +eek.jp +flop.jp +halfmoon.jp +jeez.jp +matrix.jp +mimoza.jp +ivory.ne.jp +mail-box.ne.jp +mints.ne.jp +mokuren.ne.jp +opal.ne.jp +sakura.ne.jp +sumomo.ne.jp +topaz.ne.jp +netgamers.jp +nyanta.jp +o0o0.jp +rdy.jp +rgr.jp +rulez.jp +s3.isk01.sakurastorage.jp +s3.isk02.sakurastorage.jp +saloon.jp +sblo.jp +skr.jp +tank.jp +uh-oh.jp +undo.jp +rs.webaccel.jp +user.webaccel.jp +websozai.jp +xii.jp +squares.net +jpn.org +kirara.st +x0.to +from.tv +sakura.tv + // Salesforce.com, Inc. https://salesforce.com/ // Submitted by Michael Biven *.builder.code.com @@ -13690,6 +13774,9 @@ vp4.me // Snowflake Inc : https://www.snowflake.com/ // Submitted by Faith Olapade +snowflake.app +privatelink.snowflake.app +streamlit.app streamlitapp.com // Snowplow Analytics : https://snowplowanalytics.com/ @@ -13965,6 +14052,10 @@ hk.org ltd.hk inc.hk +// UK Intis Telecom LTD : https://it.com +// Submitted by ITComdomains +it.com + // UNIVERSAL DOMAIN REGISTRY : https://www.udr.org.yt/ // see also: whois -h whois.udr.org.yt help // Submitted by Atanunu Igbunuroghene diff --git a/tox.ini b/tox.ini index f297d80..1bd494b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{27,35,36,37,38,39,310,311} + py{37,38,39,310,311} [testenv] passenv = * @@ -8,36 +8,7 @@ allowlist_externals=* deps = -r{toxinidir}/requirements/testing.txt commands = - rm -rf {toxinidir}/src_py27/ - rm -rf {toxinidir}/src_py35/ bash {toxinidir}/./scripts/clean_up.sh coverage erase pip install -e . pytest {toxinidir}/src/ - -[testenv:py27] -passenv = * -allowlist_externals=* -setenv = PYTHON_TAG = py27 -deps = - -r{toxinidir}/requirements/testing.txt -commands = - bash {toxinidir}/./scripts/prepare_build_py27.sh - bash {toxinidir}/./scripts/clean_up.sh - coverage erase - {toxinidir}/setup.py develop --python-tag py27 - pytest {toxinidir}/src_py27/ - -[testenv:py35] -passenv = * -allowlist_externals=* -setenv = PYTHON_TAG = py35 -deps = - -r{toxinidir}/requirements/testing.txt - -r{toxinidir}/requirements/release.txt -commands = - bash {toxinidir}/./scripts/prepare_build_py35.sh - bash {toxinidir}/./scripts/clean_up.sh - coverage erase - {toxinidir}/setup.py develop --python-tag py35 - pytest {toxinidir}/src_py35/ diff --git a/tox_multi.ini b/tox_multi.ini index f9b6d09..ad99849 100644 --- a/tox_multi.ini +++ b/tox_multi.ini @@ -1,38 +1,9 @@ [tox] -envlist = py{27,35,36,37,38,39,310} +envlist = py{37,38,39,310,311} [testenv] passenv = * +allowlist_externals=* deps = -r{toxinidir}/requirements/testing.txt -;commands = {envpython} -m pytest -;commands = -; {envpython} runtests.py src/ - -[testenv:py36] -commands = - {envpython} runtests.py src/ - -[testenv:py37] -commands = - {envpython} runtests.py src/ - -[testenv:py38] -commands = - {envpython} runtests.py src/ - -[testenv:py39] -commands = - {envpython} runtests.py src/ - -[testenv:py310] -commands = - {envpython} runtests.py src/ - -[testenv:py27] -commands = - {envpython} runtests.py src_py27/ --python-tag py27 - -[testenv:py35] -commands = - {envpython} runtests.py src_py35/ --python-tag py35 +commands = {envpython} -m pytest