Skip to content

Commit

Permalink
Update actions infra, pin zarr
Browse files Browse the repository at this point in the history
  • Loading branch information
benjeffery committed Jul 10, 2024
1 parent 2edadb6 commit 8d5d4c4
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 102 deletions.
13 changes: 4 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/docker/buildwheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/docker/shared.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PYTHON_VERSIONS=(
cp312-cp312
cp311-cp311
cp310-cp310
cp39-cp39
cp38-cp38
)
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
46 changes: 7 additions & 39 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,80 +11,48 @@ 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:
name: Python
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 }}
channels: conda-forge
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
30 changes: 15 additions & 15 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
24 changes: 12 additions & 12 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
--------------------
Expand Down
62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 6 additions & 6 deletions requirements/CI-docs.txt
Original file line number Diff line number Diff line change
@@ -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
setuptools_scm==8.1.0
tskit==0.5.8
zarr==2.18.2
16 changes: 8 additions & 8 deletions requirements/CI-tests-conda.txt
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 8d5d4c4

Please sign in to comment.