Skip to content

Commit c869000

Browse files
authored
Merge pull request #424 from theAeon/cy3
Support python 3.13/cython 3
2 parents 31f29ee + 8637d74 commit c869000

File tree

8 files changed

+32
-27
lines changed

8 files changed

+32
-27
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
build-and-test:
1414
strategy:
1515
matrix:
16-
python-version: ["3.9", "3.10", "3.11", "3.12"]
16+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
@@ -42,7 +42,7 @@ jobs:
4242
# with pip to make sure it works.
4343
run: |
4444
source "${HOME}/conda/etc/profile.d/conda.sh"
45-
conda create -p ./cython-env -y "cython>=0.29.30,<3.0" python=${{ matrix.python-version }} gxx zlib --channel conda-forge
45+
conda create -p ./cython-env -y "cython>3.0" python=${{ matrix.python-version }} gxx zlib setuptools --channel conda-forge
4646
conda activate ./cython-env
4747
python setup.py clean cythonize sdist
4848
(cd dist && pip install pybedtools-*.tar.gz && cd $TMPDIR && python -c 'import pybedtools; print(pybedtools.__file__)')

pybedtools/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
Attributes,
1313
MalformedBedLineError,
1414
IntervalIterator,
15+
create_interval_from_list,
1516
)
1617
from . import contrib
1718
from .helpers import (

pybedtools/cbedtools.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# cython: language_level=3str
12
from cpython cimport bool
23
from libcpp.vector cimport vector
34
from libcpp.string cimport string

pybedtools/featurefuncs.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# cython: language_level=2
22
# distutils: language = c++
33
from cbedtools cimport Interval
4-
from cbedtools import create_interval_from_list
4+
from pybedtools.cbedtools import create_interval_from_list
55

66

77
cpdef extend_fields(Interval feature, int n):

pybedtools/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
# THIS FILE IS GENERATED FROM SETUP.PY
3-
version = '0.11.0'
3+
version = '0.12.0'
44
__version__ = version

pyproject.toml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
[build-system]
2-
requires = ["setuptools>=61.0", "wheel", "Cython>=0.29.30,<3.0"]
3-
build-backend = "setuptools.build_meta:__legacy__"
2+
requires = ["setuptools>=61.0", "wheel", "Cython>=3.0"]
3+
build-backend = "setuptools.build_meta:__legacy__"
4+
5+
[project]
6+
name = "pybedtools"
7+
dynamic = ["version", "maintainers", "license", "classifiers", "readme"]
8+
description='Wrapper around BEDTools for bioinformatics work'
9+
dependencies = [
10+
"numpy",
11+
"pysam",
12+
"pandas"
13+
]
14+
[tool.pytest.ini_options]
15+
testpaths = ["pybedtools"]

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[wheel]
2-
universal = 1
1+
[bdist_wheel]
2+
33
[nosetests]
44
detailed-errors = 1
55
doctest-extension = .pyx .py

setup.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"""
2727

2828
try:
29-
from Cython.Build import build_ext as cython_build_ext
3029
from Cython.Build import cythonize
3130
HAVE_CYTHON = True
3231
except ImportError:
@@ -52,12 +51,7 @@
5251
# Try bootstrapping setuptools if it doesn't exist. This is for using the
5352
# `develop` command, which is very useful for in-place development work.
5453
try:
55-
import pkg_resources
56-
try:
57-
pkg_resources.require("setuptools>=0.6c5")
58-
except pkg_resources.VersionConflict:
59-
from ez_setup import use_setuptools
60-
use_setuptools(version="0.6c5")
54+
import setuptools
6155
from setuptools import setup, Command
6256
except ImportError:
6357
sys.exit(
@@ -68,15 +62,15 @@
6862
curdir = os.path.abspath(os.path.dirname(__file__))
6963

7064
# These imports need to be here; setuptools needs to be imported first.
71-
from distutils.extension import Extension # noqa: E402
72-
from distutils.command.build import build # noqa: E402
73-
from distutils.command.build_ext import build_ext # noqa: E402
74-
from distutils.command.sdist import sdist # noqa: E402
75-
import distutils.log
76-
65+
from setuptools.extension import Extension # noqa: E402
66+
from setuptools.command.build import build # noqa: E402
67+
from setuptools.command.build_ext import build_ext # noqa: E402
68+
from setuptools.command.sdist import sdist # noqa: E402
69+
import setuptools.logging
70+
setuptools.logging.configure()
7771

7872
MAJ = 0
79-
MIN = 11
73+
MIN = 12
8074
REV = 0
8175
VERSION = '%d.%d.%d' % (MAJ, MIN, REV)
8276

@@ -209,7 +203,7 @@ def build_extensions(self):
209203
''')
210204
self.announce(
211205
"Trying to generate the following missing files:\n%s" % "\n".join(missing_src),
212-
level=distutils.log.INFO)
206+
level=0)
213207
for src in missing_src:
214208
assert src in ext.sources
215209
(root, extn) = os.path.splitext(src)
@@ -266,7 +260,6 @@ def run(self):
266260
}
267261

268262
if USE_CYTHON:
269-
cmdclass['build_ext'] = cython_build_ext
270263
cmdclass['cythonize'] = Cythonize
271264
else:
272265
cmdclass['build_ext'] = InformativeBuildExt
@@ -296,7 +289,6 @@ def run(self):
296289
long_description=README,
297290
zip_safe=False,
298291
setup_requires=[],
299-
install_requires=['pysam', 'numpy'],
300292
classifiers=[
301293
'Development Status :: 5 - Production/Stable',
302294
'Intended Audience :: Science/Research',
@@ -324,6 +316,5 @@ def run(self):
324316
"*.h"],
325317
'src': ['src/*'],
326318
},
327-
include_package_data=True,
328-
language_level=2,
319+
include_package_data=True
329320
)

0 commit comments

Comments
 (0)