diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c9898a..b4c15b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,8 +26,6 @@ jobs: - run: name: Run Python tests command: | - # Run setup.py so that the version is defined - python3 setup.py build python3 -m pytest --cov=tszip --cov-report=xml --cov-branch -n 2 tests codecov rm .coverage @@ -40,13 +38,10 @@ jobs: name: Build Python package command: | rm -fR build - python setup.py sdist - python setup.py check - python -m twine check dist/*.tar.gz python -m venv venv source venv/bin/activate - pip install --upgrade setuptools pip wheel - python setup.py build_ext - python setup.py egg_info - python setup.py bdist_wheel + pip install --upgrade setuptools pip wheel build twine + python -m build --sdist + python -m twine check dist/*.tar.gz + python -m build --wheel pip install dist/*.tar.gz diff --git a/.github/workflows/docker/buildwheel.sh b/.github/workflows/docker/buildwheel.sh index f29b6a0..b81bd13 100644 --- a/.github/workflows/docker/buildwheel.sh +++ b/.github/workflows/docker/buildwheel.sh @@ -11,7 +11,7 @@ echo "arch=$ARCH" for V in "${PYTHON_VERSIONS[@]}"; do PYBIN=/opt/python/$V/bin rm -rf build/ # Avoid lib build by narrow Python is used by wide python - $PYBIN/python setup.py bdist_wheel + $PYBIN/python -m build --wheel done rm dist/*.tar.gz \ No newline at end of file diff --git a/.github/workflows/docker/shared.env b/.github/workflows/docker/shared.env index 3f29924..c10e471 100644 --- a/.github/workflows/docker/shared.env +++ b/.github/workflows/docker/shared.env @@ -1,6 +1,6 @@ PYTHON_VERSIONS=( + cp312-cp312 cp311-cp311 cp310-cp310 cp39-cp39 - cp38-cp38 ) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index feb731a..60b8807 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,13 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11.0 + uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" cache: 'pip' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3ea651c..d6a19f8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.0 + uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 - uses: pre-commit/action@v3.0.0 test: @@ -23,36 +23,24 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python: [ 3.8, 3.11 ] + python: [ 3.9, 3.12 ] os: [ macos-latest, ubuntu-latest, windows-latest ] defaults: run: shell: bash steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.6.0 + uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true - - name: Cache conda and dependancies - id: cache - uses: actions/cache@v2 - with: - path: | - c:\Miniconda\envs\anaconda-client-env - /usr/share/miniconda/envs/anaconda-client-env - ~/osx-conda - ~/.profile - key: ${{ runner.os }}-${{ matrix.python}}-conda-v10-${{ hashFiles('requirements/CI-tests-conda.txt') }} - - name: Install Conda - uses: conda-incubator/setup-miniconda@v2 - if: steps.cache.outputs.cache-hit != 'true' + uses: conda-incubator/setup-miniconda@v3 with: activate-environment: anaconda-client-env python-version: ${{ matrix.python }} @@ -60,31 +48,11 @@ jobs: channel-priority: strict auto-update-conda: true - - name: Fix windows .profile - if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' - run: | - cp ~/.bash_profile ~/.profile - - name: Install conda deps - if: steps.cache.outputs.cache-hit != 'true' shell: bash -l {0} #We need a login shell to get conda run: | - conda install mamba - mamba install --yes --file=requirements/CI-tests-conda.txt - - - name: Fix OSX Cache Write #OSX Won't let the cache restore due to file perms - if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' - run: | - cp -r /usr/local/miniconda/envs/anaconda-client-env ~/osx-conda - - - name: Fix OSX Cache Restore - if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest' - run: | - mkdir -p /usr/local/miniconda/envs - sudo cp -r ~/osx-conda /usr/local/miniconda/envs/anaconda-client-env + conda install --yes --file=requirements/CI-tests-conda.txt - name: Run tests run: | - source ~/.profile - conda activate anaconda-client-env python -m pytest -xv -n2 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 15efbae..f0380eb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -15,22 +15,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true - name: Set up Python 3.10 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "3.10" - name: Build sdist shell: bash run: | - python setup.py sdist + python -m build --sdist - name: Upload sdist - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: sdist path: dist @@ -41,7 +41,7 @@ jobs: docker run --rm -v `pwd`:/project -w /project quay.io/pypa/manylinux2014_x86_64 bash .github/workflows/docker/buildwheel.sh - name: Upload Wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: wheels path: dist @@ -51,14 +51,14 @@ jobs: runs-on: macos-latest strategy: matrix: - python: [3.8, 3.8, 3.9, "3.10", "3.11"] + python: [3.9, "3.10", 3.11, 3.12] steps: - name: Download wheels - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: wheels - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - name: Install wheel and test @@ -73,15 +73,15 @@ jobs: runs-on: windows-latest strategy: matrix: - python: [3.8, 3.8, 3.9, "3.10", "3.11"] + python: [3.9, "3.10", 3.11, 3.12] wordsize: [64] steps: - name: Download wheels - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: wheels - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - name: Install wheel and test @@ -97,14 +97,14 @@ jobs: needs: ['manylinux'] strategy: matrix: - python: [3.8, 3.8, 3.9, "3.10", "3.11"] + python: [3.9, "3.10", 3.11, 3.12] steps: - name: Download wheels - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: wheels - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - name: Install wheel and test @@ -123,7 +123,7 @@ jobs: id-token: write steps: - name: Download all - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 - name: Move to dist run: | mkdir dist diff --git a/.mergify.yml b/.mergify.yml index d02c7a8..36413f0 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -4,12 +4,12 @@ queue_rules: - "#approved-reviews-by>=1" - "#changes-requested-reviews-by=0" - status-success=Lint - - status-success=Python (3.8, macos-latest) - - status-success=Python (3.11, macos-latest) - - status-success=Python (3.8, ubuntu-latest) - - status-success=Python (3.11, ubuntu-latest) - - status-success=Python (3.8, windows-latest) - - status-success=Python (3.11, windows-latest) + - status-success=Python (3.9, macos-latest) + - status-success=Python (3.12, macos-latest) + - status-success=Python (3.9, ubuntu-latest) + - status-success=Python (3.12, ubuntu-latest) + - status-success=Python (3.9, windows-latest) + - status-success=Python (3.12, windows-latest) - "status-success=ci/circleci: build" pull_request_rules: - name: Automatic rebase, CI and merge @@ -20,12 +20,12 @@ pull_request_rules: - base=main - label=AUTOMERGE-REQUESTED - status-success=Lint - - status-success=Python (3.8, macos-latest) - - status-success=Python (3.11, macos-latest) - - status-success=Python (3.8, ubuntu-latest) - - status-success=Python (3.11, ubuntu-latest) - - status-success=Python (3.8, windows-latest) - - status-success=Python (3.11, windows-latest) + - status-success=Python (3.9, macos-latest) + - status-success=Python (3.12, macos-latest) + - status-success=Python (3.9, ubuntu-latest) + - status-success=Python (3.12, ubuntu-latest) + - status-success=Python (3.9, windows-latest) + - status-success=Python (3.12, windows-latest) - "status-success=ci/circleci: build" actions: queue: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7f1ce47..6908a43 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,9 @@ +-------------------- +[0.2.4] - 2024-01-XX +-------------------- + +- tszip now supports Python 3.12, 3.8 support has been removed. + -------------------- [0.2.3] - 2023-10-30 -------------------- diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4250c04 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "tszip" +authors = [ + {name = "Tskit Developers", email = "admin@tskit.dev"}, +] +description = "Compression utilities for tree sequences" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "MIT"} +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3 :: Only", + "Development Status :: 5 - Production/Stable", + "Environment :: Other Environment", + "Intended Audience :: Science/Research", + "Operating System :: POSIX", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Bio-Informatics", + "License :: OSI Approved :: MIT License", +] +keywords = ["tree sequence", "tskit"] +dependencies = [ + "numpy", + "humanize", + "tskit>=0.3.3", + "numcodecs>=0.6.4", + "zarr<3", +] +dynamic = ["version"] + +[project.urls] +Homepage = "http://pypi.python.org/pypi/tszip" +Documentation = "https://tszip.readthedocs.io/en/latest/" +Changelog = "https://tszip.readthedocs.io/en/latest/changelog.html" +"Bug Tracker" = "https://github.com/tskit-dev/tszip/issues" +GitHub = "https://github.com/tskit-dev/tszip/" + +[project.scripts] +tszip = "tszip.cli:tszip_main" +tsunzip = "tszip.cli:tsunzip_main" + +[tool.setuptools] +packages = ["tszip"] +include-package-data = true + +[tool.setuptools_scm] +write_to = "tszip/_version.py" + +[tool.pytest.ini_options] +addopts = "-n 4" +testpaths = ["tests"] diff --git a/requirements/CI-docs.txt b/requirements/CI-docs.txt index 83aaf2b..576ecbf 100644 --- a/requirements/CI-docs.txt +++ b/requirements/CI-docs.txt @@ -1,8 +1,8 @@ -humanize==4.8.0 -jupyter-book==0.15.1 +humanize==4.10.0 +jupyter-book==1.0.2 numcodecs==0.12.1 -sphinx-issues==3.0.1 +sphinx-issues==4.1.0 sphinx-argparse==0.4.0 -setuptools_scm==8.0.4 -tskit==0.5.6 -zarr==2.16.1 \ No newline at end of file +setuptools_scm==8.1.0 +tskit==0.5.8 +zarr==2.18.2 \ No newline at end of file diff --git a/requirements/CI-tests-conda.txt b/requirements/CI-tests-conda.txt index 181c40c..41610de 100644 --- a/requirements/CI-tests-conda.txt +++ b/requirements/CI-tests-conda.txt @@ -1,8 +1,8 @@ -humanize==4.8.0 -h5py==3.7.0 -msprime==1.2.0 -pytest==7.4.2 -pytest-cov==4.1.0 -pytest-xdist==3.3.1 -tskit==0.5.6 -zarr==2.16.1 +humanize==4.10.0 +h5py==3.11.0 +msprime==1.3.2 +pytest==8.2.2 +pytest-cov==5.0.0 +pytest-xdist==3.6.1 +tskit==0.5.8 +zarr==2.18.2 diff --git a/requirements/development.txt b/requirements/development.txt index f1b96f2..f8a3362 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -12,6 +12,6 @@ sphinx_rtd_theme sphinx-issues setuptools_scm tskit -zarr +zarr<3 msprime humanize diff --git a/setup.cfg b/setup.cfg index a372701..53b4424 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,6 @@ project_urls = classifiers = Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -39,7 +38,7 @@ platforms = [options] packages = tszip -python_requires = >=3.8 +python_requires = >=3.9 include_package_data = True install_requires = numpy diff --git a/setup.py b/setup.py deleted file mode 100644 index bbde4fd..0000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -from setuptools import setup - -setup( - use_scm_version={"write_to": "tszip/_version.py"}, -)