-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,199 additions
and
1,132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import nox | ||
|
||
nox.options.error_on_external_run = True | ||
nox.options.default_venv_backend = "uv" | ||
|
||
|
||
# test every version of python we support! | ||
@nox.session | ||
@nox.parametrize("python", ["3.12", "3.11", "3.10"]) | ||
def tests(session): | ||
"""Run pytest for all supported python versions""" | ||
session.run_install( | ||
"uv", | ||
"sync", | ||
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}, | ||
) | ||
session.run("pytest", "--ignore", "noxfile.py") | ||
|
||
|
||
@nox.session | ||
@nox.parametrize("python", ["3.10"]) | ||
def lint(session): | ||
"""Run linting checks""" | ||
# https://nox.thea.codes/en/stable/cookbook.html#using-a-lockfile | ||
# note: uv is set up to install the test and lint dependency groups | ||
session.run_install( | ||
"uv", | ||
"sync", | ||
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}, | ||
) | ||
session.run("ruff", "check") | ||
session.run("mypy", ".") | ||
|
||
|
||
@nox.session(default=False) | ||
def coverage(session): | ||
"""Run pytest and output a coverage report. | ||
Not default for codecov.io integration with GitHub actions | ||
""" | ||
session.run_install( | ||
"uv", | ||
"sync", | ||
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}, | ||
) | ||
session.run("pytest", "--ignore", "noxfile.py", "--cov", "--cov-report", "xml") | ||
|
||
|
||
# nox cookbook: https://nox.thea.codes/en/stable/cookbook.html | ||
# It's a good idea to keep your dev session out of the default list | ||
# so it's not run twice accidentally | ||
@nox.session(default=False) | ||
def dev(session: nox.Session) -> None: | ||
""" | ||
Set up a python development environment for the project at ".venv". | ||
""" | ||
session.run("uv", "venv") | ||
session.run("uv", "sync") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,85 @@ | ||
[tool.poetry] | ||
[project] | ||
name = "pgscatalog.calc" | ||
version = "0.3.0" | ||
description = "Libraries and applications for working with calculated polygenic scores" | ||
authors = ["Benjamin Wingfield <[email protected]>", "Samuel Lambert <[email protected]>", "Laurent Gil <[email protected]>"] | ||
license = {text = "Apache License (2.0)"} | ||
authors = [ | ||
{name = "Benjamin Wingfield", email = "[email protected]"}, | ||
{name = "Samuel Lambert", email = "[email protected]"}, | ||
{name = "Laurent Gil", email = "[email protected]"}, | ||
{name = "Florent Yvon", email = "[email protected]"} | ||
] | ||
readme = "README.md" | ||
packages = [ | ||
{ include = "pgscatalog", from = "src" }, | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.10" | ||
"pgscatalog.core" = "^0.3.1" | ||
numpy = "^1.26.4" | ||
pandas = "^2.2.0" | ||
pyarrow = "^15.0.0" | ||
scikit-learn = "^1.4.0" | ||
scipy = "^1.12.0" | ||
requires-python = ">=3.10" | ||
dependencies = [ | ||
"numpy~=1.26", | ||
"pandas~=2.2.0", | ||
"pgscatalog-core>=0.3.3", | ||
"pyarrow~=15.0.0", | ||
"scikit-learn~=1.4", | ||
"scipy~=1.12", | ||
] | ||
|
||
[tool.poetry.scripts] | ||
# https://peps.python.org/pep-0621/ | ||
[project.scripts] | ||
pgscatalog-aggregate = 'pgscatalog.calc.cli.aggregate_cli:run_aggregate' | ||
pgscatalog-ancestry-adjust = 'pgscatalog.calc.cli.ancestry_cli:run_ancestry' | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^8.0.0" | ||
pytest-cov = "^4.1.0" | ||
# https://peps.python.org/pep-0735/ | ||
[dependency-groups] | ||
lint = [ | ||
"ruff>=0.9.4", | ||
"mypy>=1.14.1" | ||
] | ||
test = [ | ||
"pytest>=8.3.4", | ||
"pytest-coverage>=0.0", | ||
] | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = ["setuptools", "setuptools-scm"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src"] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "-ra -q --doctest-modules" | ||
minversion = "8.0" | ||
addopts = "--doctest-modules" | ||
filterwarnings = ["error"] | ||
pythonpath = [ | ||
"src" | ||
] | ||
consider_namespace_packages = true | ||
|
||
[tool.coverage.run] | ||
source = ['src/pgscatalog/calc', "tests"] | ||
source = ["src/pgscatalog/core", "tests"] | ||
concurrency = ["multiprocessing"] | ||
parallel = true | ||
sigterm = true | ||
|
||
[tool.uv] | ||
default-groups = ["test", "lint"] | ||
|
||
[tool.mypy] | ||
files = ["src/**/*.py"] | ||
warn_unused_configs = true | ||
ignore_missing_imports = true | ||
follow_imports = "silent" | ||
disallow_untyped_calls = false | ||
disallow_incomplete_defs = true | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
__all__ = [] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# mypy: ignore-errors | ||
|
||
import logging | ||
import pandas as pd | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.