diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5f6db16a..6001e213 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.8.0.post2 +current_version = 3.10.0 commit = True tag = True @@ -19,10 +19,6 @@ replace = : str = "{new_version}" search = version = "{current_version}" replace = version = "{new_version}" -[bumpversion:file:setup.cfg] -search = version = {current_version} -replace = version = {new_version} - [bumpversion:file:.github/workflows/conda_ci.yml] search = ={current_version}=py_1 replace = ={new_version}=py_1 diff --git a/.dependabot/config.yml b/.dependabot/config.yml deleted file mode 100644 index 45849245..00000000 --- a/.dependabot/config.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is managed by 'repo_helper'. Don't edit it directly. ---- -version: 1 -update_configs: -- package_manager: python - directory: / - update_schedule: weekly - default_reviewers: - - domdfcoding diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e769ad3a..454225a2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,5 +6,6 @@ updates: directory: / schedule: interval: weekly + open-pull-requests-limit: 0 reviewers: - domdfcoding diff --git a/.github/workflows/conda_ci.yml b/.github/workflows/conda_ci.yml index e4df9acc..57ba7b59 100644 --- a/.github/workflows/conda_ci.yml +++ b/.github/workflows/conda_ci.yml @@ -19,19 +19,20 @@ jobs: steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Setup Python 🐍 - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: - python-version: "3.8" + python-version: "3.11" - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v2.1.1 with: activate-environment: env - conda-build-version: 3.23.3 - python-version: "3.8" + conda-build-version: 3.28.4 + miniconda-version: py311_24.1.2-0 + python-version: "3.11" miniforge-variant: Mambaforge - name: Install dependencies πŸ”§ @@ -39,7 +40,7 @@ jobs: python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade "whey-conda" "setuptools!=61.*,>=40.6.0" "wheel>=0.34.2" + python -m pip install --upgrade "whey-conda" "hatch-requirements-txt" # $CONDA is an environment variable pointing to the root of the miniconda directory $CONDA/bin/conda update -n base conda $CONDA/bin/conda config --add channels conda-forge @@ -57,7 +58,7 @@ jobs: - name: "Install package" run: | - $CONDA/bin/conda install -c file://$(pwd)/conda-bld domdf_python_tools=3.8.0.post2=py_1 -y || exit 1 + $CONDA/bin/conda install -c file://$(pwd)/conda-bld domdf_python_tools=3.10.0=py_1 -y || exit 1 - name: "Run Tests" run: | diff --git a/.github/workflows/docs_test_action.yml b/.github/workflows/docs_test_action.yml index b09bde34..8f60ba5a 100644 --- a/.github/workflows/docs_test_action.yml +++ b/.github/workflows/docs_test_action.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Check for changed files uses: dorny/paths-filter@v2 diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 8221173d..af1b3940 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -16,11 +16,11 @@ permissions: jobs: Run: name: "Flake8" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Check for changed files uses: dorny/paths-filter@v2 @@ -33,7 +33,7 @@ jobs: - name: Setup Python 🐍 if: steps.changes.outputs.code == 'true' - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: "3.8" diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 9b28b5f6..bd74787b 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -20,12 +20,12 @@ jobs: strategy: matrix: - os: ['ubuntu-20.04', 'windows-2019'] + os: ['ubuntu-22.04', 'windows-2019'] fail-fast: false steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Check for changed files uses: dorny/paths-filter@v2 @@ -38,7 +38,7 @@ jobs: - name: Setup Python 🐍 if: steps.changes.outputs.code == 'true' - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: "3.8" diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index d56dd6ab..f6491d97 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -22,29 +22,27 @@ jobs: runs-on: "windows-2019" continue-on-error: ${{ matrix.config.experimental }} env: - USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,3.12,3.13.0-alpha.2,pypy-3.6,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10' + USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10' strategy: fail-fast: False matrix: config: - - {python-version: "3.6", testenvs: "py36,build", experimental: False} - {python-version: "3.7", testenvs: "py37,build", experimental: False} - {python-version: "3.8", testenvs: "py38,build", experimental: False} - {python-version: "3.9", testenvs: "py39,build", experimental: False} - {python-version: "3.10", testenvs: "py310,build", experimental: False} - {python-version: "3.11", testenvs: "py311,build", experimental: False} - {python-version: "3.12", testenvs: "py312,build", experimental: False} - - {python-version: "3.13.0-alpha.2", testenvs: "py313-dev,build", experimental: True} - - {python-version: "pypy-3.6", testenvs: "pypy36", experimental: False} + - {python-version: "3.13", testenvs: "py313,build", experimental: False} - {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: False} - - {python-version: "pypy-3.9", testenvs: "pypy39,build", experimental: True} - - {python-version: "pypy-3.10", testenvs: "pypy310,build", experimental: True} + - {python-version: "pypy-3.9-v7.3.15", testenvs: "pypy39,build", experimental: True} + - {python-version: "pypy-3.10-v7.3.15", testenvs: "pypy310,build", experimental: True} steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true @@ -59,7 +57,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: "${{ matrix.config.python-version }}" @@ -76,8 +74,9 @@ jobs: run: python -m tox -e "${{ matrix.config.testenvs }}" -s false - name: "Upload Coverage πŸš€" - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ always() && steps.setup-python.outcome == 'success' }} with: name: "coverage-${{ matrix.config.python-version }}" path: .coverage + include-hidden-files: true diff --git a/.github/workflows/python_ci_alt_linux.yml b/.github/workflows/python_ci_alt_linux.yml index 6aa867fd..8401ea3d 100644 --- a/.github/workflows/python_ci_alt_linux.yml +++ b/.github/workflows/python_ci_alt_linux.yml @@ -20,7 +20,7 @@ permissions: jobs: tests: name: "alt-linux / Python ${{ matrix.config.python-version }}" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" container: image: ghcr.io/domdfcoding/alt-linux-python:latest continue-on-error: ${{ matrix.config.experimental }} diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index b709cdea..fb7d97ac 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -19,25 +19,23 @@ permissions: jobs: tests: - name: "ubuntu-20.04 / Python ${{ matrix.config.python-version }}" - runs-on: "ubuntu-20.04" + name: "ubuntu-22.04 / Python ${{ matrix.config.python-version }}" + runs-on: "ubuntu-22.04" continue-on-error: ${{ matrix.config.experimental }} env: - USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,3.12,3.13.0-alpha.2,pypy-3.6,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10' + USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10' strategy: fail-fast: False matrix: config: - - {python-version: "3.6", testenvs: "py36,build", experimental: False} - {python-version: "3.7", testenvs: "py37,build", experimental: False} - {python-version: "3.8", testenvs: "py38,build", experimental: False} - {python-version: "3.9", testenvs: "py39,build", experimental: False} - {python-version: "3.10", testenvs: "py310,build", experimental: False} - {python-version: "3.11", testenvs: "py311,build", experimental: False} - {python-version: "3.12", testenvs: "py312,build", experimental: False} - - {python-version: "3.13.0-alpha.2", testenvs: "py313-dev,build", experimental: True} - - {python-version: "pypy-3.6", testenvs: "pypy36,build", experimental: False} + - {python-version: "3.13", testenvs: "py313,build", experimental: False} - {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: False} - {python-version: "pypy-3.9", testenvs: "pypy39,build", experimental: True} @@ -45,7 +43,7 @@ jobs: steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true @@ -60,7 +58,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: "${{ matrix.config.python-version }}" @@ -78,22 +76,23 @@ jobs: run: python -m tox -e "${{ matrix.config.testenvs }}" -s false - name: "Upload Coverage πŸš€" - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ always() && steps.setup-python.outcome == 'success' }} with: name: "coverage-${{ matrix.config.python-version }}" path: .coverage + include-hidden-files: true Coverage: needs: tests - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Setup Python 🐍 - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: 3.8 @@ -103,7 +102,7 @@ jobs: python -m pip install --upgrade "coveralls>=3.0.0" coverage_pyver_pragma - name: "Download Coverage πŸͺ‚" - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: coverage @@ -121,10 +120,11 @@ jobs: - name: "Upload Combined Coverage Artefact πŸš€" if: ${{ steps.show.outcome != 'failure' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "combined-coverage" path: .coverage + include-hidden-files: true - name: "Upload Combined Coverage to Coveralls" if: ${{ steps.show.outcome != 'failure' }} @@ -136,14 +136,14 @@ jobs: Deploy: needs: tests - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" if: startsWith(github.ref, 'refs/tags/') - name: Setup Python 🐍 - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" if: startsWith(github.ref, 'refs/tags/') with: python-version: 3.8 @@ -184,19 +184,20 @@ jobs: if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true) steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Setup Python 🐍 - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: - python-version: 3.8 + python-version: 3.11 - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v2.1.1 with: activate-environment: env - conda-build-version: 3.23.3 - python-version: "3.8" + conda-build-version: 3.28.4 + miniconda-version: py311_24.1.2-0 + python-version: "3.11" miniforge-variant: Mambaforge - name: Install dependencies πŸ”§ @@ -204,11 +205,12 @@ jobs: python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade "mkrecipe" "setuptools!=61.*,>=40.6.0" "wheel>=0.34.2" + python -m pip install --upgrade "mkrecipe" "hatch-requirements-txt" # $CONDA is an environment variable pointing to the root of the miniconda directory $CONDA/bin/conda config --set always_yes yes --set changeps1 no $CONDA/bin/conda update -n base conda $CONDA/bin/conda info -a + $CONDA/bin/conda install conda-forge::py-lief=0.14.1 $CONDA/bin/conda config --add channels conda-forge $CONDA/bin/conda config --add channels domdfcoding diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index 742e78f9..d672cecf 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -18,32 +18,31 @@ permissions: jobs: tests: - name: "macos-latest / Python ${{ matrix.config.python-version }}" - runs-on: "macos-latest" + name: "macos-${{ matrix.config.os-ver }} / Python ${{ matrix.config.python-version }}" + runs-on: "macos-${{ matrix.config.os-ver }}" continue-on-error: ${{ matrix.config.experimental }} env: - USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,3.12,3.13.0-alpha.2,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10' + USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.7,pypy-3.8,pypy-3.9,pypy-3.10' strategy: fail-fast: False matrix: config: - - {python-version: "3.6", testenvs: "py36,build", experimental: False} - - {python-version: "3.7", testenvs: "py37,build", experimental: False} - - {python-version: "3.8", testenvs: "py38,build", experimental: False} - - {python-version: "3.9", testenvs: "py39,build", experimental: False} - - {python-version: "3.10", testenvs: "py310,build", experimental: False} - - {python-version: "3.11", testenvs: "py311,build", experimental: False} - - {python-version: "3.12", testenvs: "py312,build", experimental: False} - - {python-version: "3.13.0-alpha.2", testenvs: "py313-dev,build", experimental: True} - - {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False} - - {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: False} - - {python-version: "pypy-3.9", testenvs: "pypy39,build", experimental: True} - - {python-version: "pypy-3.10", testenvs: "pypy310,build", experimental: True} + - {python-version: "3.7", os-ver: "13", testenvs: "py37,build", experimental: False} + - {python-version: "3.8", os-ver: "14", testenvs: "py38,build", experimental: False} + - {python-version: "3.9", os-ver: "14", testenvs: "py39,build", experimental: False} + - {python-version: "3.10", os-ver: "14", testenvs: "py310,build", experimental: False} + - {python-version: "3.11", os-ver: "14", testenvs: "py311,build", experimental: False} + - {python-version: "3.12", os-ver: "14", testenvs: "py312,build", experimental: False} + - {python-version: "3.13", os-ver: "14", testenvs: "py313,build", experimental: False} + - {python-version: "pypy-3.7", os-ver: "13", testenvs: "pypy37,build", experimental: False} + - {python-version: "pypy-3.8", os-ver: "14", testenvs: "pypy38,build", experimental: False} + - {python-version: "pypy-3.9", os-ver: "14", testenvs: "pypy39,build", experimental: True} + - {python-version: "pypy-3.10", os-ver: "14", testenvs: "pypy310,build", experimental: True} steps: - name: Checkout πŸ›ŽοΈ - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true @@ -58,7 +57,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: "${{ matrix.config.python-version }}" @@ -75,8 +74,9 @@ jobs: run: python -m tox -e "${{ matrix.config.testenvs }}" -s false - name: "Upload Coverage πŸš€" - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ always() && steps.setup-python.outcome == 'success' }} with: name: "coverage-${{ matrix.config.python-version }}" path: .coverage + include-hidden-files: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 73f81d41..bc4c3b7d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ ci: repos: - repo: https://github.com/repo-helper/pyproject-parser - rev: v0.9.0 + rev: v0.13.0 hooks: - id: reformat-pyproject @@ -42,14 +42,14 @@ repos: exclude: ^(doc-source/conf|__pkginfo__|setup|tests/.*)\.py$ - id: bind-requirements - - repo: https://github.com/domdfcoding/flake8-dunder-all - rev: v0.3.0 + - repo: https://github.com/python-formate/flake8-dunder-all + rev: v0.4.1 hooks: - id: ensure-dunder-all files: ^domdf_python_tools/.*\.py$ - repo: https://github.com/domdfcoding/flake2lint - rev: v0.4.2 + rev: v0.4.3 hooks: - id: flake2lint @@ -76,18 +76,18 @@ repos: - id: forbid-crlf - repo: https://github.com/python-formate/snippet-fmt - rev: v0.1.4 + rev: v0.1.5 hooks: - id: snippet-fmt - repo: https://github.com/python-formate/formate - rev: v0.5.0 + rev: v0.8.0 hooks: - id: formate exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$ - - repo: https://github.com/domdfcoding/dep_checker - rev: v0.7.1 + - repo: https://github.com/python-coincidence/dep_checker + rev: v0.8.0 hooks: - id: dep_checker args: diff --git a/.readthedocs.yml b/.readthedocs.yml index 615e8643..e73aa4ab 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -13,9 +13,12 @@ python: - requirements: requirements.txt - requirements: doc-source/requirements.txt build: - os: ubuntu-20.04 + os: ubuntu-22.04 tools: python: '3.9' jobs: post_create_environment: - pip install .[all] + post_install: + - pip install sphinxcontrib-applehelp==1.0.4 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.1 + sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index bb6de38a..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include __pkginfo__.py -include LICENSE -include requirements.txt -prune **/__pycache__ -include domdf_python_tools/google-10000-english-no-swears.txt -recursive-include domdf_python_tools *.pyi -include domdf_python_tools/py.typed diff --git a/README.rst b/README.rst index 4222e88b..641fd161 100644 --- a/README.rst +++ b/README.rst @@ -100,7 +100,7 @@ domdf_python_tools .. |language| image:: https://img.shields.io/github/languages/top/domdfcoding/domdf_python_tools :alt: GitHub top language -.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/domdf_python_tools/v3.8.0.post2 +.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/domdf_python_tools/v3.10.0 :target: https://github.com/domdfcoding/domdf_python_tools/pulse :alt: GitHub commits since tagged version @@ -108,7 +108,7 @@ domdf_python_tools :target: https://github.com/domdfcoding/domdf_python_tools/commit/master :alt: GitHub last commit -.. |maintained| image:: https://img.shields.io/maintenance/yes/2023 +.. |maintained| image:: https://img.shields.io/maintenance/yes/2025 :alt: Maintenance .. |pypi-downloads| image:: https://img.shields.io/pypi/dm/domdf_python_tools diff --git a/doc-source/conf.py b/doc-source/conf.py index 959b96d9..2cca2611 100644 --- a/doc-source/conf.py +++ b/doc-source/conf.py @@ -75,11 +75,32 @@ } +# Fix for pathlib issue with sphinxemoji on Python 3.9 and Sphinx 4.x +def copy_asset_files(app, exc): + # 3rd party + from domdf_python_tools.compat import importlib_resources + from sphinx.util.fileutil import copy_asset + + if exc: + return + + asset_files = ["twemoji.js", "twemoji.css"] + for path in asset_files: + path_str = os.fspath(importlib_resources.files("sphinxemoji") / path) + copy_asset(path_str, os.path.join(app.outdir, "_static")) + + def setup(app): # 3rd party from sphinx_toolbox.latex import better_header_layout + from sphinxemoji import sphinxemoji app.connect("config-inited", lambda app, config: better_header_layout(config)) + app.connect("build-finished", copy_asset_files) + app.add_js_file("https://unpkg.com/twemoji@latest/dist/twemoji.min.js") + app.add_js_file("twemoji.js") + app.add_css_file("twemoji.css") + app.add_transform(sphinxemoji.EmojiSubstitutions) manpages_url = "https://manpages.debian.org/{path}" diff --git a/doc-source/index.rst b/doc-source/index.rst index bd42a60c..12f8540e 100644 --- a/doc-source/index.rst +++ b/doc-source/index.rst @@ -108,14 +108,14 @@ domdf_python_tools :alt: GitHub top language .. |commits-since| github-shield:: - :commits-since: v3.8.0.post2 + :commits-since: v3.10.0 :alt: GitHub commits since tagged version .. |commits-latest| github-shield:: :last-commit: :alt: GitHub last commit - .. |maintained| maintained-shield:: 2023 + .. |maintained| maintained-shield:: 2025 :alt: Maintenance .. |pypi-downloads| pypi-shield:: diff --git a/doc-source/requirements.txt b/doc-source/requirements.txt index 394a9bab..254a6964 100644 --- a/doc-source/requirements.txt +++ b/doc-source/requirements.txt @@ -14,10 +14,14 @@ sphinx-debuginfo>=0.2.2 sphinx-highlights>=0.1.0 sphinx-licenseinfo>=0.3.1 sphinx-notfound-page>=0.7.1 -sphinx-prompt>=1.1.0 sphinx-pyproject>=0.1.0 -sphinx-tabs>=1.1.13 sphinx-toolbox>=3.5.0 +sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-htmlhelp==2.0.1 sphinxcontrib-httpdomain>=1.7.0 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-serializinghtml==1.1.5 sphinxemoji>=0.1.6 toctree-plus>=0.6.1 diff --git a/domdf_python_tools/__init__.py b/domdf_python_tools/__init__.py index 8f398058..ee5e90b3 100644 --- a/domdf_python_tools/__init__.py +++ b/domdf_python_tools/__init__.py @@ -29,7 +29,7 @@ __author__: str = "Dominic Davis-Foster" __copyright__: str = "2014-2020 Dominic Davis-Foster" __license__: str = "MIT" -__version__: str = "3.8.0.post2" +__version__: str = "3.10.0" __email__: str = "dominic@davis-foster.co.uk" __docs = False diff --git a/domdf_python_tools/compat/importlib_resources.py b/domdf_python_tools/compat/importlib_resources.py index bc5b5451..cefee9fb 100644 --- a/domdf_python_tools/compat/importlib_resources.py +++ b/domdf_python_tools/compat/importlib_resources.py @@ -5,7 +5,7 @@ import sys from typing import Any, BinaryIO, TextIO -if sys.version_info[:2] < (3, 7): # pragma: no cover (py37+) +if sys.version_info[:2] < (3, 9): # pragma: no cover (py39+) # 3rd party import importlib_resources @@ -16,7 +16,7 @@ import importlib.resources globals().update(importlib.resources.__dict__) -if not ((3, 7) <= sys.version_info < (3, 11)): # pragma: no cover (py37 OR py38 OR py39 OR py310): +if not ((3, 9) <= sys.version_info < (3, 11)): # pragma: no cover (py39 OR py310): def _normalize_path(path: Any) -> str: """ diff --git a/domdf_python_tools/paths.py b/domdf_python_tools/paths.py index 1f298525..f7c6b7b3 100644 --- a/domdf_python_tools/paths.py +++ b/domdf_python_tools/paths.py @@ -130,6 +130,7 @@ ".tox4", ".nox", "__pypackages__", + "dosdevices", ) """ A list of directories which will likely be unwanted when searching directory trees for files. diff --git a/formate.toml b/formate.toml index b6364ffa..95093bce 100644 --- a/formate.toml +++ b/formate.toml @@ -6,21 +6,17 @@ noqa-reformat = 60 ellipsis-reformat = 70 squish_stubs = 80 -[config] -indent = "\t" -line_length = 115 - [hooks.yapf] priority = 30 -[hooks.isort] -priority = 50 - [hooks.yapf.kwargs] yapf_style = ".style.yapf" +[hooks.isort] +priority = 50 + [hooks.isort.kwargs] -indent = "\t\t" +indent = " " multi_line_output = 8 import_heading_stdlib = "stdlib" import_heading_thirdparty = "3rd party" @@ -56,4 +52,8 @@ known_third_party = [ "requests", "typing_extensions", ] -known_first_party = "domdf_python_tools" +known_first_party = [ "domdf_python_tools",] + +[config] +indent = " " +line_length = 115 diff --git a/pyproject.toml b/pyproject.toml index 520c3991..35144b6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = [ "setuptools!=61.*,>=40.6.0", "wheel>=0.34.2",] -build-backend = "setuptools.build_meta" +requires = [ "hatch-requirements-txt",] +build-backend = "hatchling.build" [project] name = "domdf_python_tools" -version = "3.8.0.post2" +version = "3.10.0" description = "Helpful functions for Pythonβ€‚πŸβ€‚πŸ› οΈ" readme = "README.rst" requires-python = ">=3.6" @@ -16,13 +16,13 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", @@ -30,14 +30,13 @@ classifiers = [ ] dynamic = [ "dependencies",] +[project.license] +file = "LICENSE" + [[project.authors]] name = "Dominic Davis-Foster" email = "dominic@davis-foster.co.uk" - -[project.license] -file = "LICENSE" - [project.urls] Homepage = "https://github.com/domdfcoding/domdf_python_tools" "Issue Tracker" = "https://github.com/domdfcoding/domdf_python_tools/issues" @@ -75,7 +74,6 @@ extensions = [ "sphinx.ext.mathjax", "sphinxcontrib.extras_require", "sphinx.ext.todo", - "sphinxemoji.sphinxemoji", "notfound.extension", "sphinx_copybutton", "sphinxcontrib.default_values", @@ -89,7 +87,6 @@ extensions = [ "sphinx_toolbox.latex.succinct_seealso", "latex_unicode", ] -sphinxemoji_style = "twemoji" gitstamp_fmt = "%d %b %Y" templates_path = [ "_templates",] html_static_path = [ "_static",] @@ -145,7 +142,7 @@ base-classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", ] -python-versions = [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12",] +python-versions = [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13",] python-implementations = [ "CPython", "PyPy",] platforms = [ "Windows", "macOS", "Linux",] license-key = "MIT" @@ -162,6 +159,16 @@ show_error_codes = true [tool.snippet-fmt] directives = [ "code-block",] +[tool.snippet-fmt.languages.python] +reformat = true + +[tool.snippet-fmt.languages.TOML] +reformat = true + +[tool.snippet-fmt.languages.ini] + +[tool.snippet-fmt.languages.json] + [tool.setuptools] zip-safe = false include-package-data = true @@ -178,12 +185,21 @@ include = false order = 30 include = false -[tool.snippet-fmt.languages.python] -reformat = true +[tool.hatch.build] +exclude = [ + "/*", + "!/domdf_python_tools", + "!/domdf_python_tools/**/requirements.txt", + "!/requirements.txt", + "tests", + "doc-source", +] -[tool.snippet-fmt.languages.TOML] -reformat = true +[tool.hatch.build.sdist] +include = [ "domdf_python_tools", "requirements.txt",] -[tool.snippet-fmt.languages.ini] +[tool.hatch.build.wheel] +include = [ "domdf_python_tools",] -[tool.snippet-fmt.languages.json] +[tool.hatch.metadata.hooks.requirements_txt] +files = [ "requirements.txt",] diff --git a/repo_helper.yml b/repo_helper.yml index fd75732b..e2f87c8e 100644 --- a/repo_helper.yml +++ b/repo_helper.yml @@ -3,7 +3,7 @@ modname: domdf_python_tools copyright_years: "2019-2022" author: "Dominic Davis-Foster" email: "dominic@davis-foster.co.uk" -version: "3.8.0.post2" +version: "3.10.0" username: "domdfcoding" license: 'MIT' short_desc: 'Helpful functions for Pythonβ€‚πŸβ€‚πŸ› οΈ' @@ -14,20 +14,19 @@ min_coverage: 95 tox_testenv_extras: all pre_commit_exclude: "^domdf_python_tools/compat/importlib_resources.py$" docs_fail_on_warning: true +use_hatch: true conda_channels: - conda-forge python_versions: - 3.6: 3.7: 3.8: 3.9: "3.10": "3.11": "3.12": - "3.13-dev": - pypy36: + "3.13": pypy37: pypy38: pypy39: diff --git a/requirements.txt b/requirements.txt index f228c8da..d38fb0b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ importlib-metadata>=3.6.0; python_version < "3.9" -importlib-resources>=3.0.0; python_version < "3.7" +importlib-resources>=3.0.0; python_version < "3.9" natsort>=7.0.1 typing-extensions>=3.7.4.1 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 26c97a00..00000000 --- a/setup.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# This file is managed by 'repo_helper'. -# You may add new sections, but any changes made to the following sections will be lost: -# * metadata -# * options -# * options.packages.find -# * mypy -# * options.entry_points - -[metadata] -name = domdf_python_tools -version = 3.8.0.post2 -author = Dominic Davis-Foster -author_email = dominic@davis-foster.co.uk -license = MIT License -keywords = utilities -long_description = file: README.rst -long_description_content_type = text/x-rst -platforms = Windows, macOS, Linux -url = https://github.com/domdfcoding/domdf_python_tools -project_urls = - Documentation = https://domdf-python-tools.readthedocs.io/en/latest - Issue Tracker = https://github.com/domdfcoding/domdf_python_tools/issues - Source Code = https://github.com/domdfcoding/domdf_python_tools -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Topic :: Software Development :: Libraries :: Python Modules - Typing :: Typed - -[options] -python_requires = >=3.6 -zip_safe = False -include_package_data = True -packages = find: - -[options.packages.find] -exclude = - doc-source - tests - tests.* diff --git a/setup.py b/setup.py deleted file mode 100644 index 5bed656d..00000000 --- a/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -# This file is managed by 'repo_helper'. Don't edit it directly. - -# stdlib -import pathlib -import shutil -import sys - -# 3rd party -from setuptools import setup - -sys.path.append('.') - -# this package -from __pkginfo__ import * # pylint: disable=wildcard-import - -repo_root = pathlib.Path(__file__).parent -install_requires = (repo_root / "requirements.txt").read_text(encoding="UTF-8").split('\n') - -setup( - description="Helpful functions for Pythonβ€‚πŸβ€‚πŸ› οΈ", - extras_require=extras_require, - install_requires=install_requires, - name="domdf-python-tools", - py_modules=[], - ) - -shutil.rmtree("domdf_python_tools.egg-info", ignore_errors=True) diff --git a/stubs.txt b/stubs.txt index c181ed15..2471af61 100644 --- a/stubs.txt +++ b/stubs.txt @@ -1,4 +1,3 @@ -git+https://github.com/domdfcoding/natsort-stubs pandas-stubs; implementation_name == "cpython" and python_version < "3.10" types-click types-pytz diff --git a/tests/list_tests.py b/tests/list_tests.py index 45acf1b0..2c6f7050 100644 --- a/tests/list_tests.py +++ b/tests/list_tests.py @@ -74,6 +74,7 @@ def test_repr(self): assert repr(a2) == "[0, 1, 2, [...], 3]" @not_pypy() + @pytest.mark.skipif(sys.version_info >= (3, 12), reason="Doesn't error on newer Pythons") def test_repr_deep(self): a = self.type2test([]) for i in range(1500 + 1): # sys.getrecursionlimit() + 100 diff --git a/tests/test_docstrings.py b/tests/test_docstrings.py index f67adaea..049a1965 100644 --- a/tests/test_docstrings.py +++ b/tests/test_docstrings.py @@ -39,4 +39,4 @@ def test_docstrings(module): print(indent(stdout.getvalue(), " ")) if runner.failures: - pytest.fail(msg=f"{runner.failures} tests failed") + pytest.fail(f"{runner.failures} tests failed") diff --git a/tests/test_paths_/test_iterchildren_match.yml b/tests/test_paths_/test_iterchildren_match.yml index 9fcd4b87..5b019781 100644 --- a/tests/test_paths_/test_iterchildren_match.yml +++ b/tests/test_paths_/test_iterchildren_match.yml @@ -29,7 +29,6 @@ - domdf_python_tools/utils.py - domdf_python_tools/versions.py - domdf_python_tools/words.py -- setup.py - tests/__init__.py - tests/conftest.py - tests/discover_demo_module/__init__.py diff --git a/tests/test_utils.py b/tests/test_utils.py index 7ef7c8c3..768bd836 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -124,11 +124,17 @@ def test_printr(obj, expects, capsys): assert re.match(expects, stdout[0]) +if sys.version_info >= (3, 13): + pure_posix_path_expected = "" +else: + pure_posix_path_expected = "" + + @pytest.mark.parametrize( "obj, expects", [ ("This is a test", ""), - (pathlib.PurePosixPath("foo.txt"), ""), + (pathlib.PurePosixPath("foo.txt"), pure_posix_path_expected), (1234, ""), (12.34, ""), (CustomRepr(), ""), diff --git a/tox.ini b/tox.ini index 5f4dacae..f9e840ae 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ # * envlists # * testenv:.package # * testenv:py313-dev +# * testenv:py313 # * testenv:py312-dev # * testenv:py312 # * testenv:docs @@ -21,15 +22,13 @@ [tox] envlist = - py36 py37 py38 py39 py310 py311 py312 - py313-dev - pypy36 + py313 pypy37 pypy38 pypy39 @@ -46,15 +45,13 @@ requires = [envlists] test = - py36 py37 py38 py39 py310 py311 py312 - py313-dev - pypy36 + py313 pypy37 pypy38 pypy39 @@ -67,12 +64,15 @@ setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 -[testenv:py313-dev] +[testenv:py313] +download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 + UNSAFE_PYO3_SKIP_VERSION_CHECK=1 [testenv:py312] +download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 @@ -91,13 +91,13 @@ setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 + UNSAFE_PYO3_SKIP_VERSION_CHECK=1 skip_install = True changedir = {toxinidir} deps = build[virtualenv]>=0.3.1 check-wheel-contents>=0.1.0 - twine>=3.2.0; python_version < "3.13" - twine@git+https://github.com/pypa/twine; python_version >= "3.13" + twine>=3.2.0 cryptography<40; implementation_name == "pypy" and python_version <= "3.7" commands = python -m build --sdist --wheel "{toxinidir}" @@ -119,7 +119,7 @@ deps = flake8-github-actions>=0.1.0 flake8-noqa>=1.1.0,<=1.2.2 flake8-pyi>=20.10.0,<=22.8.0 - flake8-pytest-style>=1.3.0 + flake8-pytest-style>=1.3.0,<2 flake8-quotes>=3.3.0 flake8-slots>=0.1.0 flake8-sphinx-links>=0.0.4 @@ -229,8 +229,8 @@ exclude_lines = raise NotImplementedError if 0: if False: - if TYPE_CHECKING: - if typing.TYPE_CHECKING: + if TYPE_CHECKING + if typing.TYPE_CHECKING if __name__ == .__main__.: [check-wheel-contents]