Skip to content

Commit 9cf7c6c

Browse files
Merge pull request #151 from ravwojdyla/rav-use-pyproject
Consolidate project config under pyproject
2 parents 1b24cbe + c03b708 commit 9cf7c6c

File tree

7 files changed

+91
-102
lines changed

7 files changed

+91
-102
lines changed

.gitignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# auto generated by setuptools_scm and configured in pyproject.toml
2+
bio2zarr/_version.py
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]
@@ -152,9 +155,9 @@ dmypy.json
152155
# Cython debug symbols
153156
cython_debug/
154157

155-
# PyCharm
156-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158-
# and can be added to the global gitignore or merged into this file. For a more nuclear
159-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160-
#.idea/
158+
# IDE
159+
.vscode
160+
.idea
161+
162+
# Mac
163+
.DS_Store

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- id: check-case-conflict
99
- id: check-yaml
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.3.7
11+
rev: v0.4.2
1212
hooks:
1313
- id: ruff
1414
args: [ --fix ]

bio2zarr/vcf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import shutil
1313
import sys
1414
import tempfile
15-
from typing import Any, List
15+
from typing import Any
1616

1717
import cyvcf2
1818
import humanfriendly
@@ -746,9 +746,9 @@ class IcfFieldWriter:
746746
transformer: VcfValueTransformer
747747
compressor: Any
748748
max_buffered_bytes: int
749-
buff: List[Any] = dataclasses.field(default_factory=list)
749+
buff: list[Any] = dataclasses.field(default_factory=list)
750750
buffered_bytes: int = 0
751-
chunk_index: List[int] = dataclasses.field(default_factory=lambda: [0])
751+
chunk_index: list[int] = dataclasses.field(default_factory=lambda: [0])
752752
num_records: int = 0
753753

754754
def append(self, val):

bio2zarr/vcf_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import os
44
import pathlib
55
import struct
6+
from collections.abc import Sequence
67
from dataclasses import dataclass
7-
from typing import IO, Any, Dict, Optional, Sequence, Union
8+
from typing import IO, Any, Optional, Union
89

910
import cyvcf2
1011
import humanfriendly
@@ -183,7 +184,7 @@ def get_first_locus_in_bin(csi: CSIIndex, bin: int) -> int:
183184

184185

185186
def read_csi(
186-
file: PathType, storage_options: Optional[Dict[str, str]] = None
187+
file: PathType, storage_options: Optional[dict[str, str]] = None
187188
) -> CSIIndex:
188189
"""Parse a CSI file into a `CSIIndex` object.
189190
@@ -297,7 +298,7 @@ def offsets(self) -> Any:
297298

298299

299300
def read_tabix(
300-
file: PathType, storage_options: Optional[Dict[str, str]] = None
301+
file: PathType, storage_options: Optional[dict[str, str]] = None
301302
) -> TabixIndex:
302303
"""Parse a tabix file into a `TabixIndex` object.
303304

pyproject.toml

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,85 @@
1+
[build-system]
2+
requires = ["setuptools >= 69", "setuptools_scm[toml] >= 8"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "bio2zarr"
7+
description = "Convert bioinformatics data to Zarr"
8+
readme = "README.md"
9+
license = {file = "LICENSE"}
10+
authors = [
11+
{name = "sgkit Developers", email = "project@pystatgen.org"},
12+
]
13+
dependencies = [
14+
"numpy",
15+
"zarr >= 2.17",
16+
"click",
17+
"tabulate",
18+
"tqdm",
19+
"humanfriendly",
20+
# cyvcf2 also pulls in coloredlogs and click",
21+
# colouredlogs pulls in humanfriendly",
22+
"cyvcf2",
23+
"bed_reader",
24+
]
25+
requires-python = ">=3.9"
26+
classifiers = [
27+
"Development Status :: 3 - Alpha",
28+
"License :: OSI Approved :: Apache, Software License",
29+
"Operating System :: OS Independent",
30+
"Intended Audience :: Science/Research",
31+
"Programming Language :: Python",
32+
"Programming Language :: Python :: 3",
33+
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
"Topic :: Scientific/Engineering"
37+
]
38+
dynamic = ["version"]
39+
40+
[project.urls]
41+
repository = "https://github.com/sgkit-dev/bio2zarr"
42+
documentation = "https://sgkit-dev.github.io/bio2zarr/intro.html"
43+
44+
[project.scripts]
45+
vcf2zarr = "bio2zarr.cli:vcf2zarr"
46+
plink2zarr = "bio2zarr.cli:plink2zarr"
47+
vcf_partition = "bio2zarr.cli:vcf_partition"
48+
49+
[tool.setuptools]
50+
packages = ["bio2zarr"]
51+
52+
[tool.setuptools_scm]
53+
version_file = "bio2zarr/_version.py"
54+
55+
[tool.pytest.ini_options]
56+
testpaths = "tests"
57+
addopts = "--cov=bio2zarr --cov-report term-missing"
58+
159
[tool.ruff]
60+
# Assume Python 3.9
61+
target-version = "py39"
62+
263
# Same as Black.
364
line-length = 88
465
indent-width = 4
566

6-
# Assume Python 3.8
7-
target-version = "py38"
8-
967
[tool.ruff.lint]
1068
select = ["E", "F", "B", "W", "I", "N", "UP", "A", "RUF", "PT"]
1169
#Allow uppercase names for e.g. call_AD
1270
ignore = ["N806", "N802", "A001", "A002"]
1371

1472
fixable = ["ALL"]
15-
unfixable = []
73+
unfixable = []
74+
75+
[tool.ruff.lint.isort]
76+
known-third-party = [
77+
"hypothesis",
78+
"msprime",
79+
"numpy",
80+
"pandas",
81+
"pytest",
82+
"setuptools",
83+
"sgkit",
84+
"zarr"
85+
]

setup.cfg

Lines changed: 0 additions & 76 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)