Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ on:
merge_group:
jobs:
Docs:
uses: tskit-dev/.github/.github/workflows/docs-build-template.yml@main
uses: tskit-dev/.github/.github/workflows/docs-build-template.yml@v1
27 changes: 16 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,38 @@ jobs:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.3.0
with:
python-version: '3.10'
python-version: '3.12'
- uses: pre-commit/action@v3.0.1

test:
name: Python
runs-on: ubuntu-24.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

python: [ "3.10", 3.13 ]
os: [ macos-latest, ubuntu-24.04, windows-latest ]
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.3.0
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python }}
version: "0.8.15"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements/CI-tests-pip/requirements.txt
uv venv
uv pip install -r pyproject.toml --extra test
- name: Test with pytest
run: |
python3 -m pytest --cov=tstrait --cov-report=xml --cov-branch -n 0 tests
uv run --no-sync python -m pytest --cov=tstrait --cov-report=xml --cov-branch -n 0 tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5.1.1
env:
Expand All @@ -64,7 +69,7 @@ jobs:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.3.0
with:
python-version: '3.10'
python-version: '3.12'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.3.0
with:
python-version: '3.10'
python-version: '3.12'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python: [3.8, 3.9, "3.10", "3.11"]
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Download wheels
uses: actions/download-artifact@v4.1.8
Expand All @@ -62,7 +62,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python: [3.8, 3.9, "3.10", "3.11"]
python: ["3.10", "3.11", "3.12", "3.13"]
wordsize: [64]
steps:
- name: Download wheels
Expand All @@ -86,7 +86,7 @@ jobs:
needs: ['distbuild']
strategy:
matrix:
python: [3.8, 3.9, "3.10", "3.11"]
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Download wheels
uses: actions/download-artifact@v4.1.8
Expand Down
18 changes: 11 additions & 7 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,21 @@ Afterwards, go to Github and open a pull request by pressing a green Pull Reques

## Requirements

The list of packages needed for development are listed in `requirements.development.txt`.
Install these by using either:
The packages needed for development are specified as optional dependencies
in the ``pyproject.toml`` file. Install these using:

```
conda install --file requirements/development.txt
python3 -m venv env
source env/bin/activate
python3 -m pip install -e ".[dev]"
```

or
Alternatively, you can use uv for faster dependency management:

```
python -m pip install -r requirements/development.txt
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
```

## Documentation
Expand Down Expand Up @@ -111,8 +115,8 @@ the desired statistical properties. Since these tests are quite expensive to run
validate, they are not run as part of continuous integration (CI) but instead as a pre-release sanity check.

The statistical tests are all run via the `verification.py` script in the project root. The script has some
extra dependencies listed in the `requirements/verification.txt`, which can be installed using
`pip install -r` or `conda install --file`. You should also need to install [R](https://www.r-project.org/)
extra dependencies specified in the `verification` optional dependencies in `pyproject.toml`, which can be installed using
`pip install -e ".[verification]"` or `uv pip install -e ".[verification]"`. You should also need to install [R](https://www.r-project.org/)
into your environment. Run this script using:

```
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We recommend using `conda` for most users.

## System requirements

tstrait requires Python 3.8+. Python dependencies are installed automatically by `pip` or `conda`.
tstrait requires Python 3.10+. Python dependencies are installed automatically by `pip` or `conda`.

## Via conda

Expand Down
127 changes: 125 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,126 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=64",
"setuptools-scm>=8",
]
build-backend = "setuptools.build_meta"

[project]
name = "tstrait"
dynamic = [
"version",
]
description = "Quantitative trait simulation of tree sequence data"
readme = "README.md"
maintainers = [
{ name = "Tskit Developers", email = "admin@tskit.dev" },
]
authors = [
{ name = "Daiki Tagami et al." },
]
keywords = [
"gwas",
"population genetics",
"quantitative trait",
"simulation",
"statistical genetics",
"tree sequence",
"tskit",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: MacOS",
]
requires-python = ">=3.10"
dependencies = [
"numpy>=1.20.3",
"numba>=0.57.0",
"pandas>=1.0",
"tskit>=0.5.5",
]

[project.license]
text = "MIT"

[project.urls]
Homepage = "https://tskit.dev/tstrait/"
"Bug Tracker" = "https://github.com/tskit-dev/tstrait/issues"
Documentation = "https://tskit.dev/tstrait/docs/"
"Source Code" = "https://github.com/tskit-dev/tstrait"

[project.optional-dependencies]
test = [
"msprime==1.3.4",
"numba==0.61.2",
"pandas==2.3.2",
"tskit==0.6.4",
"pytest==8.4.2",
"pytest-cov==6.3.0",
"pytest-xdist==3.8.0",
"scipy==1.15.3",
]
docs = [
"jupyter-book==1.0.4.post1",
"matplotlib==3.10.6",
"msprime==1.3.4",
"numba==0.61.2",
"numpydoc==1.9.0",
"pandas==2.3.2",
"sphinx-issues==5.0.1",
"tskit==0.6.4",
]
dev = [
"jupyter-book",
"matplotlib",
"msprime",
"numba",
"numpy",
"numpydoc",
"pandas",
"pre-commit",
"pytest",
"scipy",
"sphinx",
"sphinx-issues",
"tskit",
"pytest-cov",
"pytest-xdist",
]
verification = [
"matplotlib",
"numpy",
"pandas",
"scipy",
"statsmodels",
"seaborn",
"tqdm",
"argparse",
"daiquiri",
"msprime",
]

[tool.setuptools]
packages = [
"tstrait",
]

[tool.setuptools_scm]

[tool.pytest.ini_options]
testpaths = [
"tests",
]
7 changes: 0 additions & 7 deletions requirements/CI-complete/requirements.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements/CI-docs/requirements.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements/CI-tests-pip/requirements.txt

This file was deleted.

13 changes: 0 additions & 13 deletions requirements/development.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements/verification.txt

This file was deleted.

Loading
Loading