From 8455745e32d5802fc3dcedfbcc9d5e1abd8e6b4f Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Tue, 21 Jan 2025 15:38:04 +0100 Subject: [PATCH 1/5] Bump to 0.3.3 --- py2bit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py2bit.h b/py2bit.h index b7f4a1b..bee30dc 100644 --- a/py2bit.h +++ b/py2bit.h @@ -1,7 +1,7 @@ #include #include "2bit.h" -#define pyTwoBitVersion "0.3.2" +#define pyTwoBitVersion "0.3.3" typedef struct { PyObject_HEAD From 088f063f63fad7336e877f9ee4ea1f981fa34bff Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Tue, 21 Jan 2025 15:41:08 +0100 Subject: [PATCH 2/5] try removing setup.py --- setup.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100755 setup.py diff --git a/setup.py b/setup.py deleted file mode 100755 index bc10a0a..0000000 --- a/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -from setuptools import setup, Extension, find_packages -from distutils import sysconfig -import subprocess -import glob -import sys - -srcs = [x for x in - glob.glob("lib2bit/*.c")] -srcs.append("py2bit.c") - -additional_libs = [sysconfig.get_config_var("LIBDIR"), sysconfig.get_config_var("LIBPL")] - -module1 = Extension('py2bit', - sources = srcs, - library_dirs = additional_libs, - include_dirs = ['lib2bit', sysconfig.get_config_var("INCLUDEPY")]) - -setup(name = 'py2bit', - version = '0.3.3', - description = 'A package for accessing 2bit files using lib2bit', - author = "Devon P. Ryan", - author_email = "dpryan79@gmail.com", - url = "https://github.com/deeptools/py2bit", - license = "MIT", - download_url = "https://github.com/deeptools/py2bit", - keywords = ["bioinformatics", "2bit"], - classifier = ["Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved", - "Programming Language :: C", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: Implementation :: CPython", - "Operating System :: POSIX", - "Operating System :: Unix", - "Operating System :: MacOS"], - packages = find_packages(), - include_package_data=True, - ext_modules = [module1]) From aafea91db8db8ee6a2240c537f52957d7a782a73 Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Tue, 21 Jan 2025 15:45:50 +0100 Subject: [PATCH 3/5] Try this --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ae5db1e..2e56737 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,12 @@ classifiers = [ download = "https://github.com/deeptools/py2bit" homepage = "https://github.com/deeptools/py2bit" +[tool.setuptools] +# Override setuptools autodiscovery algorithm +# Only include package test data/source for wheel distribution +include-package-data = true +packages = ["py2bitTest"] + # Enable version inference from scm [tool.setuptools_scm] From cdaf52bb0b69afe3340097354f997b291847b0cc Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Tue, 21 Jan 2025 15:51:33 +0100 Subject: [PATCH 4/5] Explicitly add both modules --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2e56737..77aad19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ homepage = "https://github.com/deeptools/py2bit" # Override setuptools autodiscovery algorithm # Only include package test data/source for wheel distribution include-package-data = true -packages = ["py2bitTest"] +packages = ["py2bit", "py2bitTest"] # Enable version inference from scm [tool.setuptools_scm] From 85692661b40b10f8ebd63c6c1e47ed745138ab60 Mon Sep 17 00:00:00 2001 From: Devon Ryan Date: Tue, 21 Jan 2025 16:12:16 +0100 Subject: [PATCH 5/5] setup.py is actually needed, but we can slim it down and switch to sysconfig --- pyproject.toml | 4 ++-- setup.py | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 77aad19..a6d4a8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "setuptools-scm"] +requires = ["setuptools>=74.1", "setuptools-scm"] build-backend = "setuptools.build_meta" [project] @@ -34,7 +34,7 @@ homepage = "https://github.com/deeptools/py2bit" # Override setuptools autodiscovery algorithm # Only include package test data/source for wheel distribution include-package-data = true -packages = ["py2bit", "py2bitTest"] +packages = ["py2bitTest"] # Enable version inference from scm [tool.setuptools_scm] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..7f91207 --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ +from setuptools import setup, Extension +import glob +import sysconfig + +srcs = [x for x in + glob.glob("lib2bit/*.c")] +srcs.append("py2bit.c") + +additional_libs = [sysconfig.get_config_var("LIBDIR"), sysconfig.get_config_var("LIBPL")] + +module1 = Extension('py2bit', + sources = srcs, + library_dirs = additional_libs, + include_dirs = ['lib2bit', sysconfig.get_config_var("INCLUDEPY")]) + +setup_args = dict(ext_modules=[module1]) +setup(**setup_args)