From c2ca148e1e2b02e1d507d0d73dff36e9ea0a3c6a Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 16 Sep 2024 21:17:08 +0200 Subject: [PATCH 01/76] cibuildwheel first try --- .github/workflows/python-build-wheels.yml | 32 +++++++++++++++++++++++ .github/workflows/python-package.yml | 3 +++ pyproject.toml | 3 +++ 3 files changed, 38 insertions(+) create mode 100644 .github/workflows/python-build-wheels.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml new file mode 100644 index 0000000..dc02182 --- /dev/null +++ b/.github/workflows/python-build-wheels.yml @@ -0,0 +1,32 @@ +name: Build wheels + +on: [workflow_dispatch] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + # macos-13 is an intel runner, macos-14 is apple silicon + os: [ubuntu-latest] + #, windows-latest, macos-13, macos-14] + python-version: [ "3.11" ] # "3.7", "3.8", "3.9", "3.10", + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.21.0 + # env: + # CIBW_SOME_OPTION: value + # ... + # with: + # package-dir: . + # output-dir: wheelhouse + # config-file: "{package}/pyproject.toml" + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl \ No newline at end of file diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c1c10c5..ab81695 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -40,3 +40,6 @@ jobs: run: | pip install pytest pytest + + + \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4892761 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "cython", "numpy"] +build-backend = "setuptools.build_meta" \ No newline at end of file From ab43a22fd8ef80893bd84d73f3bb28efd214535b Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 16 Sep 2024 21:22:16 +0200 Subject: [PATCH 02/76] cibuildwheels add pysam --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4892761..50a527d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "cython", "numpy"] +requires = ["setuptools", "cython", "numpy", "pysam"] build-backend = "setuptools.build_meta" \ No newline at end of file From 00464c66d3557498f582a91da60707227f53d432 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 16 Sep 2024 21:36:33 +0200 Subject: [PATCH 03/76] cibuildwheel add bzip dep --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 50a527d..f9485e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ [build-system] requires = ["setuptools", "cython", "numpy", "pysam"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" + +[tool.cibuildwheel.linux] +before-all = "yum install bzip2-libs" \ No newline at end of file From 800207a758d2b2b80d14323d716ca5dae1d7f107 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 16 Sep 2024 21:40:56 +0200 Subject: [PATCH 04/76] cibuildwheel update deps --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f9485e0..35361d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,4 +3,4 @@ requires = ["setuptools", "cython", "numpy", "pysam"] build-backend = "setuptools.build_meta" [tool.cibuildwheel.linux] -before-all = "yum install bzip2-libs" \ No newline at end of file +before-all = "yum install bzip2-devel" \ No newline at end of file From f83de4533eaa677b92ae3964410690564f18515a Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 16 Sep 2024 21:49:34 +0200 Subject: [PATCH 05/76] cibuildwheel add -y option --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 35361d3..bf3b11d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,4 +3,4 @@ requires = ["setuptools", "cython", "numpy", "pysam"] build-backend = "setuptools.build_meta" [tool.cibuildwheel.linux] -before-all = "yum install bzip2-devel" \ No newline at end of file +before-all = "yum install bzip2-devel -y" \ No newline at end of file From 64f2e933976025ab4c2b3f050bcd0cbf0ac3a889 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 16 Sep 2024 21:52:52 +0200 Subject: [PATCH 06/76] cibuildwheel add xz-devel --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bf3b11d..e4b70d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,4 +3,4 @@ requires = ["setuptools", "cython", "numpy", "pysam"] build-backend = "setuptools.build_meta" [tool.cibuildwheel.linux] -before-all = "yum install bzip2-devel -y" \ No newline at end of file +before-all = "yum install bzip2-devel xz-devel -y" \ No newline at end of file From 313713ce55b7a47b860292de7c8d14b1519ca57f Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 17 Sep 2024 09:21:47 +0200 Subject: [PATCH 07/76] cibuildwheel python version --- .github/workflows/python-build-wheels.yml | 5 ++++- pyproject.toml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index dc02182..9457774 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -15,7 +15,10 @@ jobs: steps: - uses: actions/checkout@v4 - + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - name: Build wheels uses: pypa/cibuildwheel@v2.21.0 # env: diff --git a/pyproject.toml b/pyproject.toml index e4b70d7..3ebeb92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,5 +2,8 @@ requires = ["setuptools", "cython", "numpy", "pysam"] build-backend = "setuptools.build_meta" +[project] +requires-python = ">=3.8" + [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y" \ No newline at end of file From 1568d45c4de18eb62cbaac1592cf2d5268d0e4e9 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 17 Sep 2024 09:26:29 +0200 Subject: [PATCH 08/76] cibuildwheel update toml --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3ebeb92..d3b3b88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,8 @@ requires = ["setuptools", "cython", "numpy", "pysam"] build-backend = "setuptools.build_meta" [project] +name = "pairtools" +dynamic = ['version'] requires-python = ">=3.8" [tool.cibuildwheel.linux] From 1d3ce5491149f909b229943f3747eb65b4446298 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 17 Sep 2024 09:29:50 +0200 Subject: [PATCH 09/76] cibuildwheel toml --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d3b3b88..a04256b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,10 +2,10 @@ requires = ["setuptools", "cython", "numpy", "pysam"] build-backend = "setuptools.build_meta" -[project] -name = "pairtools" -dynamic = ['version'] -requires-python = ">=3.8" +# [project] +# name = "pairtools" +# dynamic = ['version', 'description', 'author', 'author_email', 'url', 'license', 'keywords', 'classifiers', 'long_description', 'long_description_content_type'] +# requires-python = ">=3.8" [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y" \ No newline at end of file From 5ec7d02269c90aefcc1473f407caaa95ba2b9406 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 17 Sep 2024 09:41:12 +0200 Subject: [PATCH 10/76] drop support for py3.7 --- pyproject.toml | 8 ++++---- setup.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a04256b..b81e9d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,10 +2,10 @@ requires = ["setuptools", "cython", "numpy", "pysam"] build-backend = "setuptools.build_meta" -# [project] -# name = "pairtools" -# dynamic = ['version', 'description', 'author', 'author_email', 'url', 'license', 'keywords', 'classifiers', 'long_description', 'long_description_content_type'] -# requires-python = ">=3.8" +[project] +name = "pairtools" +dynamic = ['version', 'author', 'author_email', 'license', 'url', 'description', 'keywords', 'classifiers'] +requires-python = ">=3.8" [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y" \ No newline at end of file diff --git a/setup.py b/setup.py index e4d7742..2af2eb3 100644 --- a/setup.py +++ b/setup.py @@ -25,10 +25,10 @@ Operating System :: OS Independent Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 """ @@ -133,7 +133,7 @@ def run(self): zip_safe=False, classifiers=[s.strip() for s in classifiers.split("\n") if s], install_requires=install_requires, - python_requires=">=3.7", + python_requires=">=3.8", entry_points={ "console_scripts": [ "pairtools = pairtools.cli:cli", From 4ede69ccc713092b355606f0e9c9872f7bbb673a Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 17 Sep 2024 09:44:01 +0200 Subject: [PATCH 11/76] cibuildwheel fix toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b81e9d0..968bb88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pairtools" -dynamic = ['version', 'author', 'author_email', 'license', 'url', 'description', 'keywords', 'classifiers'] +dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', 'classifiers'] requires-python = ">=3.8" [tool.cibuildwheel.linux] From a8c954289e9a8e861fd129e0d9a35dd8b653f039 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 17 Sep 2024 09:48:10 +0200 Subject: [PATCH 12/76] update toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 968bb88..8846eb5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pairtools" -dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', 'classifiers'] +dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', 'classifiers', 'readme', 'scripts', 'dependencies'] requires-python = ">=3.8" [tool.cibuildwheel.linux] From caaca5d0570f2ea1db157c045f46171c2b15e1f0 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 17 Sep 2024 09:51:22 +0200 Subject: [PATCH 13/76] setup.py : do not updaste __NUMPY_SETUP_ --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2af2eb3..8f0f7eb 100644 --- a/setup.py +++ b/setup.py @@ -100,7 +100,7 @@ def finalize_options(self): # Fix to work with bootstrapped numpy installation # http://stackoverflow.com/a/21621689/579416 # Prevent numpy from thinking it is still in its setup process: - __builtins__.__NUMPY_SETUP__ = False + #__builtins__.__NUMPY_SETUP__ = False import numpy self.include_dirs.append(numpy.get_include()) From 510f99c37d9ee34e7398283b7443930ff7faff91 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 17 Sep 2024 10:00:39 +0200 Subject: [PATCH 14/76] fix setup.py --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8f0f7eb..05e81e3 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,8 @@ def get_version(): def get_ext_modules(): ext = ".pyx" if HAVE_CYTHON else ".c" src_files = glob.glob( - os.path.join(os.path.dirname(__file__), "pairtools", "lib", "*" + ext) + #os.path.join(os.path.dirname(__file__), "pairtools", "lib", "*" + ext) + os.path.join("pairtools", "lib", "*" + ext) ) ext_modules = [] From 35754ac9525cf98183cb4347a0c4eef05c23f93f Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 7 Oct 2024 20:30:53 +0200 Subject: [PATCH 15/76] attempt to fix repair wheel --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8846eb5..c454d45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "cython", "numpy", "pysam"] +requires = ["setuptools", "cython", "numpy",] # "pysam"] build-backend = "setuptools.build_meta" [project] @@ -8,4 +8,4 @@ dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', requires-python = ">=3.8" [tool.cibuildwheel.linux] -before-all = "yum install bzip2-devel xz-devel -y" \ No newline at end of file +before-all = "yum install bzip2-devel xz-devel -y; pip install cython numpy; pip install --no-binary pysam" \ No newline at end of file From 94655b22dc6b569c298bab917712a28837bc7bc6 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 7 Oct 2024 20:33:22 +0200 Subject: [PATCH 16/76] fix --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c454d45..785e7aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,4 +8,4 @@ dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', requires-python = ">=3.8" [tool.cibuildwheel.linux] -before-all = "yum install bzip2-devel xz-devel -y; pip install cython numpy; pip install --no-binary pysam" \ No newline at end of file +before-all = "yum install bzip2-devel xz-devel -y; pip install cython numpy; pip install pysam --no-binary" \ No newline at end of file From 2368bde863d1b24c16442c57d748c1142d019973 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 7 Oct 2024 20:36:22 +0200 Subject: [PATCH 17/76] fix --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 785e7aa..817c483 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,4 +8,4 @@ dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', requires-python = ">=3.8" [tool.cibuildwheel.linux] -before-all = "yum install bzip2-devel xz-devel -y; pip install cython numpy; pip install pysam --no-binary" \ No newline at end of file +before-all = "yum install bzip2-devel xz-devel -y; pip install cython numpy; pip install pysam --no-binary pysam" \ No newline at end of file From c210cde0e184ba12b01b9cae1085eb6d6aef9cf5 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 7 Oct 2024 20:44:20 +0200 Subject: [PATCH 18/76] fix --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 817c483..804b76f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "cython", "numpy",] # "pysam"] +requires = ["setuptools", "cython", "numpy"] # "pysam"] build-backend = "setuptools.build_meta" [project] @@ -8,4 +8,5 @@ dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', requires-python = ">=3.8" [tool.cibuildwheel.linux] -before-all = "yum install bzip2-devel xz-devel -y; pip install cython numpy; pip install pysam --no-binary pysam" \ No newline at end of file +before-all = "yum install bzip2-devel xz-devel -y;" +before-build = "pip install pysam --no-binary " \ No newline at end of file From a792104b5d95687dbf4e290740cab0c76adb33b5 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 7 Oct 2024 20:46:40 +0200 Subject: [PATCH 19/76] fix --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 804b76f..753d7c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,4 +9,4 @@ requires-python = ">=3.8" [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y;" -before-build = "pip install pysam --no-binary " \ No newline at end of file +before-build = "pip install pysam --no-binary pysam" \ No newline at end of file From c1351138b8d18aba4dfa83a51eab9727dd5be676 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 18 Nov 2024 20:46:39 +0100 Subject: [PATCH 20/76] attempt to fix pysam install --- pyproject.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 753d7c1..6c36537 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,9 @@ [build-system] -requires = ["setuptools", "cython", "numpy"] # "pysam"] +requires = [ + "setuptools", + "cython", + "numpy"] + # "pysam"] build-backend = "setuptools.build_meta" [project] @@ -9,4 +13,4 @@ requires-python = ">=3.8" [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y;" -before-build = "pip install pysam --no-binary pysam" \ No newline at end of file +before-build = "python -m pip install pysam --no-binary pysam" \ No newline at end of file From 136d44d5fc69630cec1f3fa7fd428cfb4bcc394d Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 10:35:14 +0100 Subject: [PATCH 21/76] fix pysam --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6c36537..993f783 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,4 +13,7 @@ requires-python = ">=3.8" [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y;" -before-build = "python -m pip install pysam --no-binary pysam" \ No newline at end of file +#before-build = "python -m pip install pysam --no-binary pysam" + +[tool.cibuildwheel.linux.environment] +PIP_NO_BINARY = "pysam" \ No newline at end of file From 35b95eb87f453b48c72b8e6925b3ca40e7c05275 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 10:35:33 +0100 Subject: [PATCH 22/76] fix pysam #2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 993f783..b8402ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "setuptools", "cython", "numpy"] - # "pysam"] + "pysam"] build-backend = "setuptools.build_meta" [project] From c795ddefa6aacf9ef62052296bf5ff3b26066889 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 10:39:54 +0100 Subject: [PATCH 23/76] fix pysam --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b8402ca..5dcee4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools", "cython", - "numpy"] + "numpy", "pysam"] build-backend = "setuptools.build_meta" From 24b8c95bdef5e115363faa2951d7250b4d325309 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 10:53:11 +0100 Subject: [PATCH 24/76] bump py version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5dcee4e..b8c2b6d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" [project] name = "pairtools" dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', 'classifiers', 'readme', 'scripts', 'dependencies'] -requires-python = ">=3.8" +requires-python = ">=3.9" [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y;" From a0c2d0ab02129cb702df2d54f6006cae1a8febbe Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 11:10:55 +0100 Subject: [PATCH 25/76] fix pysam --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b8c2b6d..4385ac8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,4 +16,5 @@ before-all = "yum install bzip2-devel xz-devel -y;" #before-build = "python -m pip install pysam --no-binary pysam" [tool.cibuildwheel.linux.environment] -PIP_NO_BINARY = "pysam" \ No newline at end of file +PIP_NO_BINARY = "pysam" +PIP_NO_CACHE_DIR = "false" \ No newline at end of file From 93bfddc5ca1c24f89b3f4d2ce1301d5a07bb0a4b Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 11:26:44 +0100 Subject: [PATCH 26/76] ciwheel: lower version --- .github/workflows/python-build-wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 9457774..e478a6c 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -20,7 +20,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Build wheels - uses: pypa/cibuildwheel@v2.21.0 + #uses: pypa/cibuildwheel@v2.21.0 + uses: pypa/cibuildwheel@v2.17.0 # env: # CIBW_SOME_OPTION: value # ... From 9ae65e63a12a2508ab61f5c71b82d180852b7aec Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 16:38:23 +0100 Subject: [PATCH 27/76] another attempt at cibw --- .github/workflows/python-build-wheels.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index e478a6c..ff0c612 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -19,16 +19,25 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + # - name: Build wheels + # uses: pypa/cibuildwheel@v2.21.0 + # # uses: pypa/cibuildwheel@v2.17.0 + # # env: + # # CIBW_SOME_OPTION: value + # # ... + # # with: + # # package-dir: . + # # output-dir: wheelhouse + # # config-file: "{package}/pyproject.toml" + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.21.3 + - name: Build wheels - #uses: pypa/cibuildwheel@v2.21.0 - uses: pypa/cibuildwheel@v2.17.0 + run: python -m cibuildwheel --output-dir wheelhouse + # to supply options, put them in 'env', like: # env: # CIBW_SOME_OPTION: value - # ... - # with: - # package-dir: . - # output-dir: wheelhouse - # config-file: "{package}/pyproject.toml" - uses: actions/upload-artifact@v4 with: From 968cd3816f56f4c3fbaeef534d5aca37bba11eed Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 17:09:18 +0100 Subject: [PATCH 28/76] cibuildwheel fix --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4385ac8..ad9ada8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,4 +17,5 @@ before-all = "yum install bzip2-devel xz-devel -y;" [tool.cibuildwheel.linux.environment] PIP_NO_BINARY = "pysam" -PIP_NO_CACHE_DIR = "false" \ No newline at end of file +PIP_NO_CACHE_DIR = "false" +PIP_NO_BUILD_ISOLATION = "false" \ No newline at end of file From 0696a234647a4dbf3b1550a1cbe3d2c66f648470 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 17:13:06 +0100 Subject: [PATCH 29/76] cibuildwheel --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ad9ada8..16e3de8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,4 +18,5 @@ before-all = "yum install bzip2-devel xz-devel -y;" [tool.cibuildwheel.linux.environment] PIP_NO_BINARY = "pysam" PIP_NO_CACHE_DIR = "false" -PIP_NO_BUILD_ISOLATION = "false" \ No newline at end of file +PIP_NO_BUILD_ISOLATION = "false" +PIP_VERBOSE = "true" \ No newline at end of file From f7923090bc1862459adb3f367695bd22545f2db6 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 17:15:15 +0100 Subject: [PATCH 30/76] cibuildwheel --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 16e3de8..513dd04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,5 +18,5 @@ before-all = "yum install bzip2-devel xz-devel -y;" [tool.cibuildwheel.linux.environment] PIP_NO_BINARY = "pysam" PIP_NO_CACHE_DIR = "false" -PIP_NO_BUILD_ISOLATION = "false" +#PIP_NO_BUILD_ISOLATION = "false" PIP_VERBOSE = "true" \ No newline at end of file From ae42407bf7a4093429f1ab48363452feb12cc29f Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 19:07:25 +0100 Subject: [PATCH 31/76] cibuildwheel fix --- .github/workflows/python-build-wheels.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index ff0c612..06938ec 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -36,8 +36,8 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse # to supply options, put them in 'env', like: - # env: - # CIBW_SOME_OPTION: value + env: + CIBW_BUILD_FRONTEND: "build" - uses: actions/upload-artifact@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 513dd04..aea2081 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,4 +19,4 @@ before-all = "yum install bzip2-devel xz-devel -y;" PIP_NO_BINARY = "pysam" PIP_NO_CACHE_DIR = "false" #PIP_NO_BUILD_ISOLATION = "false" -PIP_VERBOSE = "true" \ No newline at end of file +#PIP_VERBOSE = "true" From cce89a7a14d6fd10f797fe7096796832a5d1fd07 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 20:31:28 +0100 Subject: [PATCH 32/76] cibuildwheel --- .github/workflows/python-build-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 06938ec..24c4177 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -38,6 +38,7 @@ jobs: # to supply options, put them in 'env', like: env: CIBW_BUILD_FRONTEND: "build" + PIP_NO_BUILD_ISOLATION: "false" - uses: actions/upload-artifact@v4 with: From 2669f2cfa831d83333c257cf49ec3737cdc8efa1 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 19 Nov 2024 20:45:11 +0100 Subject: [PATCH 33/76] cibuildwheel --- .github/workflows/python-build-wheels.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 24c4177..3646ad7 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -37,8 +37,9 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse # to supply options, put them in 'env', like: env: - CIBW_BUILD_FRONTEND: "build" - PIP_NO_BUILD_ISOLATION: "false" + #CIBW_BUILD_FRONTEND: "build" + CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" + #PIP_NO_BUILD_ISOLATION: "false" - uses: actions/upload-artifact@v4 with: From 371865f1f1935454e25f05050e30ac9d4128a0f0 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 2 Dec 2024 21:31:27 +0100 Subject: [PATCH 34/76] last fix?.. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 05e81e3..6e9aebe 100644 --- a/setup.py +++ b/setup.py @@ -80,9 +80,10 @@ def get_ext_modules(): Extension( name, [src_file], - extra_link_args=pysam.get_libraries(), + #extra_link_args=pysam.get_libraries(), include_dirs=pysam.get_include(), define_macros=pysam.get_defines(), + #libraries=['libchtslib'], #extra_objects=pysam.get_libraries(), ) ) From 700ecb6164ad440a435360ded12bcd1d4d03404e Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 2 Dec 2024 21:34:46 +0100 Subject: [PATCH 35/76] last last fix? --- .github/workflows/python-build-wheels.yml | 4 ++-- pyproject.toml | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 3646ad7..108443d 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -37,8 +37,8 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse # to supply options, put them in 'env', like: env: - #CIBW_BUILD_FRONTEND: "build" - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" + CIBW_BUILD_FRONTEND: "build" + #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" #PIP_NO_BUILD_ISOLATION: "false" - uses: actions/upload-artifact@v4 diff --git a/pyproject.toml b/pyproject.toml index aea2081..a033308 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,17 @@ build-backend = "setuptools.build_meta" [project] name = "pairtools" -dynamic = ['version', 'authors', 'license', 'urls', 'description', 'keywords', 'classifiers', 'readme', 'scripts', 'dependencies'] +dynamic = [ + 'version', + 'authors', + 'license', + 'urls', + 'description', + 'keywords', + 'classifiers', + 'readme', + 'scripts', + 'dependencies'] requires-python = ">=3.9" [tool.cibuildwheel.linux] From 5f87d21050e77f93cce17b133a21adbcc6c2b5b6 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 2 Dec 2024 21:44:52 +0100 Subject: [PATCH 36/76] fix --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6e9aebe..e619f9a 100644 --- a/setup.py +++ b/setup.py @@ -76,11 +76,12 @@ def get_ext_modules(): ) else: import pysam + print(pysam.get_libraries()) ext_modules.append( Extension( name, [src_file], - #extra_link_args=pysam.get_libraries(), + extra_link_args=pysam.get_libraries(), include_dirs=pysam.get_include(), define_macros=pysam.get_defines(), #libraries=['libchtslib'], From ae823c20787a90945576a3b8b3a3e243a3b99589 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 2 Dec 2024 21:53:26 +0100 Subject: [PATCH 37/76] fix py>=3.11 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a033308..f98ff42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dynamic = [ 'readme', 'scripts', 'dependencies'] -requires-python = ">=3.9" +requires-python = ">=3.11" [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y;" From c0836e3efb0ae51e7f46f59b7df7b8664529a1f1 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 2 Dec 2024 22:00:10 +0100 Subject: [PATCH 38/76] test --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f98ff42..961aebf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,5 +28,5 @@ before-all = "yum install bzip2-devel xz-devel -y;" [tool.cibuildwheel.linux.environment] PIP_NO_BINARY = "pysam" PIP_NO_CACHE_DIR = "false" -#PIP_NO_BUILD_ISOLATION = "false" +PIP_NO_BUILD_ISOLATION = "false" #PIP_VERBOSE = "true" From 0529e11deac96b72043dc2befff1389d96bd3227 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 2 Dec 2024 22:00:19 +0100 Subject: [PATCH 39/76] test --- .github/workflows/python-build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 108443d..723f510 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -37,7 +37,7 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse # to supply options, put them in 'env', like: env: - CIBW_BUILD_FRONTEND: "build" + CIBW_BUILD_FRONTEND: "build; args: -n" #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" #PIP_NO_BUILD_ISOLATION: "false" From b5df8adadaf8309845399e079f1e6c116fd6e4b3 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 2 Dec 2024 22:06:05 +0100 Subject: [PATCH 40/76] test --- .github/workflows/python-build-wheels.yml | 4 ++-- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 723f510..406bbb3 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -37,8 +37,8 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse # to supply options, put them in 'env', like: env: - CIBW_BUILD_FRONTEND: "build; args: -n" - #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" + #CIBW_BUILD_FRONTEND: "build; args: -n" + CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" #PIP_NO_BUILD_ISOLATION: "false" - uses: actions/upload-artifact@v4 diff --git a/pyproject.toml b/pyproject.toml index 961aebf..b6fb4ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,7 @@ requires = [ "numpy", "pysam"] build-backend = "setuptools.build_meta" +#build-backend = "build" [project] name = "pairtools" From 401050041550eb98d6975bad69ba4a1e1ea157c4 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 2 Dec 2024 22:09:08 +0100 Subject: [PATCH 41/76] another test --- .github/workflows/python-build-wheels.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 406bbb3..723f510 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -37,8 +37,8 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse # to supply options, put them in 'env', like: env: - #CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" + CIBW_BUILD_FRONTEND: "build; args: -n" + #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" #PIP_NO_BUILD_ISOLATION: "false" - uses: actions/upload-artifact@v4 diff --git a/pyproject.toml b/pyproject.toml index b6fb4ea..3ee9933 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ requires-python = ">=3.11" [tool.cibuildwheel.linux] before-all = "yum install bzip2-devel xz-devel -y;" -#before-build = "python -m pip install pysam --no-binary pysam" +before-build = "python -m pip install setuptools cython numpy pysam --no-binary pysam" [tool.cibuildwheel.linux.environment] PIP_NO_BINARY = "pysam" From a1d0b755fa470017bf23c75f8ac4085c2f05aef1 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 21:19:24 +0100 Subject: [PATCH 42/76] fix --- .github/workflows/python-build-wheels.yml | 16 +++-- pyproject.toml | 79 +++++++++++++++-------- setup.py | 42 ++---------- 3 files changed, 68 insertions(+), 69 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 723f510..74fdfdb 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -31,17 +31,21 @@ jobs: # # config-file: "{package}/pyproject.toml" - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: python -m pip install cibuildwheel==2.22.0 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse # to supply options, put them in 'env', like: env: - CIBW_BUILD_FRONTEND: "build; args: -n" #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" + CIBW_BUILD_FRONTEND: "build; args: -n" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel -y;" + CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam" + #PIP_NO_CACHE_DIR: "false" #PIP_NO_BUILD_ISOLATION: "false" + #PIP_NO_BINARY: "pysam" - - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl \ No newline at end of file + # - uses: actions/upload-artifact@v4 + # with: + # name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + # path: ./wheelhouse/*.whl \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3ee9933..bdd1502 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,56 @@ +[project] +name = "pairtools" +dynamic = ['version',] + +dependencies = [ + 'cython', + 'numpy>=1.10', + 'click>=6.6', + 'scipy>=1.7.0', + 'pandas>=1.3.4', + 'pysam>=0.15.0', + 'pyyaml', + 'bioframe>=0.3.3', +] +requires-python = ">=3.9" + +description = "CLI tools to process mapped Hi-C data" +authors = [ + {name = "Open2C", email = "open.chromosome.collective@gmail.com"}, +] +license = {text = "MIT License"} +keywords = ["genomics", "bioinformatics", "Hi-C", "contact", "chromosome"] +readme = "README.md" + +classifiers = [ + "Development Status :: 5 - Production/Stable", + + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Bio-Informatics", + "Operating System :: OS Independent", + + "License :: OSI Approved :: MIT License", + + "Programming Language :: Python", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] + + +[project.urls] +Homepage = "https://github.com/open2c/pairtools" +Documentation = "https://pairtools.readthedocs.io/en/latest/" +Repository = "https://github.com/open2c/pairtools.git" +Issues = "https://github.com/open2c/pairtools/issues" +Changelog = "https://github.com/open2c/pairtools/blob/master/CHANGES.md" + + +[project.scripts] +pairtools = "pairtools.cli:cli" + + [build-system] requires = [ "setuptools", @@ -5,29 +58,3 @@ requires = [ "numpy", "pysam"] build-backend = "setuptools.build_meta" -#build-backend = "build" - -[project] -name = "pairtools" -dynamic = [ - 'version', - 'authors', - 'license', - 'urls', - 'description', - 'keywords', - 'classifiers', - 'readme', - 'scripts', - 'dependencies'] -requires-python = ">=3.11" - -[tool.cibuildwheel.linux] -before-all = "yum install bzip2-devel xz-devel -y;" -before-build = "python -m pip install setuptools cython numpy pysam --no-binary pysam" - -[tool.cibuildwheel.linux.environment] -PIP_NO_BINARY = "pysam" -PIP_NO_CACHE_DIR = "false" -PIP_NO_BUILD_ISOLATION = "false" -#PIP_VERBOSE = "true" diff --git a/setup.py b/setup.py index e619f9a..97170e5 100644 --- a/setup.py +++ b/setup.py @@ -20,17 +20,6 @@ print('Cython was not found!') HAVE_CYTHON = False -classifiers = """\ - Development Status :: 4 - Beta - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 -""" - def _read(*parts, **kwargs): filepath = os.path.join(os.path.dirname(__file__), *parts) @@ -49,11 +38,6 @@ def get_version(): return version -long_description = _read("README.md") - -install_requires = [l for l in _read("requirements.txt").split("\n") if l] - - def get_ext_modules(): ext = ".pyx" if HAVE_CYTHON else ".c" src_files = glob.glob( @@ -76,7 +60,6 @@ def get_ext_modules(): ) else: import pysam - print(pysam.get_libraries()) ext_modules.append( Extension( name, @@ -84,8 +67,6 @@ def get_ext_modules(): extra_link_args=pysam.get_libraries(), include_dirs=pysam.get_include(), define_macros=pysam.get_defines(), - #libraries=['libchtslib'], - #extra_objects=pysam.get_libraries(), ) ) @@ -121,27 +102,14 @@ def run(self): setup( - name="pairtools", - author="Open2C", - author_email="open.chromosome.collective@gmail.com", version=get_version(), - license="MIT", - description="CLI tools to process mapped Hi-C data", - long_description=long_description, - long_description_content_type="text/markdown", - keywords=["genomics", "bioinformatics", "Hi-C", "contact"], - url="https://github.com/open2c/pairtools", ext_modules=get_ext_modules(), cmdclass={"build_ext": build_ext}, zip_safe=False, - classifiers=[s.strip() for s in classifiers.split("\n") if s], - install_requires=install_requires, - python_requires=">=3.8", - entry_points={ - "console_scripts": [ - "pairtools = pairtools.cli:cli", - #'pairsamtools = pairtools.cli:cli', - ] - }, + # entry_points={ + # "console_scripts": [ + # "pairtools = pairtools.cli:cli", + # ] + # }, packages=find_packages(), ) From 36c04f0590cdf39a3fef73c1e5438e7af5c7b6e3 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 21:34:11 +0100 Subject: [PATCH 43/76] drop 32-bit --- .github/workflows/python-build-wheels.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 74fdfdb..f218d5b 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -41,6 +41,9 @@ jobs: CIBW_BUILD_FRONTEND: "build; args: -n" CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam" + + CIBW_ARCHS_LINUX: "auto64" + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" #PIP_NO_CACHE_DIR: "false" #PIP_NO_BUILD_ISOLATION: "false" #PIP_NO_BINARY: "pysam" From e6aaf63f3b734103a499d9cde457b961a8ba0e71 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 21:37:51 +0100 Subject: [PATCH 44/76] fix using pysam.whl --- .github/workflows/python-build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index f218d5b..eb84dcb 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,7 +39,7 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel -y;" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel libnghttp2 -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam" CIBW_ARCHS_LINUX: "auto64" From 39298dca70755756e695d59beefe95f5ad309e36 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 21:39:51 +0100 Subject: [PATCH 45/76] add pysam dependency?.. --- .github/workflows/python-build-wheels.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index eb84dcb..3e9803e 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -42,8 +42,15 @@ jobs: CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel libnghttp2 -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam" + # skip building 32-bit wheels (i686) CIBW_ARCHS_LINUX: "auto64" + + # use 2_28 to download pysam's wheel instead of compiling it CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" + + ## skip building pypy + CIBW_SKIP: pp* + #PIP_NO_CACHE_DIR: "false" #PIP_NO_BUILD_ISOLATION: "false" #PIP_NO_BINARY: "pysam" From b866db2ec383431444e2243b15da8a525e9af812 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 21:46:29 +0100 Subject: [PATCH 46/76] pysam no-binary --- .github/workflows/python-build-wheels.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 3e9803e..6b3c951 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,13 +39,15 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel libnghttp2 -y;" - CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel -y;" + CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam --no-binary pysam" # skip building 32-bit wheels (i686) CIBW_ARCHS_LINUX: "auto64" - # use 2_28 to download pysam's wheel instead of compiling it + # use 2_28 to download pysam's wheel instead of compiling it ; + # THAT DIDN'T WORK THOUGH BECAUSE PYSAM DEPENDS ON LIBSSL, LIBNGHTTP2, ETC, WHICH CANNOT BE FOUND + # SO WE ARE BACK TO COMPILING PYSAM'S WHEEL (no-binary pysam) CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" ## skip building pypy From a82edeb0dfd6f2116fdea4171bcfe8740c2bc43e Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 22:20:55 +0100 Subject: [PATCH 47/76] migrate all dependencies to pyproject toml --- pyproject.toml | 17 +++++++++++++++++ requirements-dev.txt | 4 ---- requirements.txt | 8 -------- requirements_doc.txt | 15 --------------- 4 files changed, 17 insertions(+), 27 deletions(-) delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt delete mode 100644 requirements_doc.txt diff --git a/pyproject.toml b/pyproject.toml index bdd1502..d141c7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,23 @@ classifiers = [ "Programming Language :: Python :: 3.12", ] +[project.optional-dependencies] +test = [ + 'pytest', + 'pytest-flake8', + 'pytest-cov', +] + +doc = [ + 'sphinx-click', + 'ipython', + 'nbsphinx', + 'Sphinx>=7.0', + 'sphinx_rtd_theme', + 'docutils>0.16', +] + + [project.urls] Homepage = "https://github.com/open2c/pairtools" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index cd1855a..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,4 +0,0 @@ --r requirements.txt -pytest -pytest-flake8 -pytest-cov diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9f1e03e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -cython -numpy>=1.10 -click>=6.6 -scipy>=1.7.0 -pandas>=1.3.4 -pysam>=0.15.0 -pyyaml -bioframe>=0.3.3 \ No newline at end of file diff --git a/requirements_doc.txt b/requirements_doc.txt deleted file mode 100644 index bda504f..0000000 --- a/requirements_doc.txt +++ /dev/null @@ -1,15 +0,0 @@ -Cython -numpy -nose -scipy -pandas -pysam -bioframe -click>=7.0 -sphinx-click -ipython -nbsphinx -Sphinx>=7.0 -sphinx_rtd_theme -docutils>0.16 --e . From 1dda01add370f1f621522eafadef1cca509b369c Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 22:29:11 +0100 Subject: [PATCH 48/76] update actions and readme --- .github/workflows/python-build-wheels.yml | 4 ++-- .github/workflows/python-package.yml | 8 +++----- README.md | 15 +++++++++++---- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 6b3c951..6bc5b6b 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -50,8 +50,8 @@ jobs: # SO WE ARE BACK TO COMPILING PYSAM'S WHEEL (no-binary pysam) CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" - ## skip building pypy - CIBW_SKIP: pp* + ## skip building pypy and musllinux + CIBW_SKIP: pp* *muslinux* #PIP_NO_CACHE_DIR: "false" #PIP_NO_BUILD_ISOLATION: "false" diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ab81695..4a44d77 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 @@ -26,10 +26,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip wheel setuptools - pip install numpy cython pysam - pip install -r requirements-dev.txt - pip install -e . + python -m pip install --upgrade pip wheel setuptools build + pip install -e ./ --no-build-isolation - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/README.md b/README.md index 0926478..7c9c8fc 100644 --- a/README.md +++ b/README.md @@ -50,21 +50,28 @@ Requirements: - Python packages `cython`, `pysam`, `bioframe`, `pyyaml`, `numpy`, `scipy`, `pandas` and `click`. - Command-line utilities `sort` (the Unix version), `bgzip` (shipped with `samtools`) and `samtools`. If available, `pairtools` can compress outputs with `pbgzip` and `lz4`. -For the full list of recommended versions, see [requirements in the the GitHub repo](https://github.com/open2c/pairtools/blob/detect_mutations/requirements.txt). +For the full list of recommended versions, see [the requirements section in the pyproject.toml](https://github.com/open2c/pairtools/blob/main/pyproject.toml). We highly recommend using the `conda` package manager to install `pairtools` together with all its dependencies. To get it, you can either install the full [Anaconda](https://www.continuum.io/downloads) Python distribution or just the standalone [conda](http://conda.pydata.org/miniconda.html) package manager. With `conda`, you can install `pairtools` and all of its dependencies from the [bioconda](https://bioconda.github.io/index.html) channel. ```sh -$ conda install -c conda-forge -c bioconda pairtools +$ conda install -c bioconda -c conda-forge pairtools ``` -Alternatively, install non-Python dependencies and `pairtools` with Python-only dependencies from PyPI using pip: +Alternatively, install non-Python dependencies separately and download `pairtools` with Python dependencies from PyPI using pip: ```sh -$ pip install numpy pysam cython $ pip install pairtools ``` +Finally, for development purposes, build `pairtools` from source via pip's "editable" mode: +```sh +$ git clone https://github.com/open2c/pairtools +$ cd pairtools +$ pip install -e ./ --no-build-isolation +``` + + ## Quick example Setup a new test folder and download a small Hi-C dataset mapped to sacCer3 genome: From 21d7550fd614005f91d516602d7281efe70064dd Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 22:33:02 +0100 Subject: [PATCH 49/76] fix testing action --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4a44d77..37dd696 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,7 +27,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip wheel setuptools build - pip install -e ./ --no-build-isolation + pip install -e .[test] --no-build-isolation - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From 8740a59fb959d9203e23d11fa3b8a93e681372c4 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 22:38:55 +0100 Subject: [PATCH 50/76] add verbosity to tests --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 37dd696..964f092 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,7 +27,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip wheel setuptools build - pip install -e .[test] --no-build-isolation + pip install -e .[test] --no-build-isolation -v -v -v - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From bb1f90165cb857fd6297243686d69bbdad9f4345 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 22:45:43 +0100 Subject: [PATCH 51/76] install cython explicitly --- .github/workflows/python-package.yml | 4 ++-- README.md | 1 + setup.py | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 964f092..ac620e6 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,8 +26,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip wheel setuptools build - pip install -e .[test] --no-build-isolation -v -v -v + python -m pip install --upgrade pip wheel setuptools build cython + pip install -e .[test] --no-build-isolation -v -v - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/README.md b/README.md index 7c9c8fc..53d0cd5 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ $ pip install pairtools Finally, for development purposes, build `pairtools` from source via pip's "editable" mode: ```sh +$ pip install Cython pysam numpy $ git clone https://github.com/open2c/pairtools $ cd pairtools $ pip install -e ./ --no-build-isolation diff --git a/setup.py b/setup.py index 97170e5..5b036e1 100644 --- a/setup.py +++ b/setup.py @@ -16,10 +16,9 @@ HAVE_CYTHON = True except ImportError: - from setuptools.command.build_ext import build_ext as _build_ext + #from setuptools.command.build_ext import build_ext as _build_ext print('Cython was not found!') - HAVE_CYTHON = False - + raise ImportError('Cython is required to build the extension modules.') def _read(*parts, **kwargs): filepath = os.path.join(os.path.dirname(__file__), *parts) From b479d06ad4f4eeda7d930b9d85d3fac0d1e5f307 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 22:47:25 +0100 Subject: [PATCH 52/76] install pysam and numpy in testing --- .github/workflows/python-package.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ac620e6..de6cc79 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,7 +26,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip wheel setuptools build cython + python -m pip install --upgrade pip wheel setuptools build + pip install cython pysam numpy pip install -e .[test] --no-build-isolation -v -v - name: Lint with flake8 run: | From f94ea8370c53c03cb2ce61420436d30533304cc2 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 22:53:19 +0100 Subject: [PATCH 53/76] test no nobinary --- .github/workflows/python-build-wheels.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 6bc5b6b..1580c15 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,8 +39,9 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel -y;" - CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam --no-binary pysam" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel -y;" + CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam " + #--no-binary pysam" # skip building 32-bit wheels (i686) CIBW_ARCHS_LINUX: "auto64" From 02b0906ce5dc5bfba7732b3792b1cbc9da5b284d Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 22:58:18 +0100 Subject: [PATCH 54/76] fix --- .github/workflows/python-build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 1580c15..867bc96 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,7 +39,7 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel -y;" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam " #--no-binary pysam" From 19730978473c5c892c0ecd2e37ecf8125cf92787 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 23:01:33 +0100 Subject: [PATCH 55/76] fix --- .github/workflows/python-build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 867bc96..3021759 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,7 +39,7 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel -y;" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-libs -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam " #--no-binary pysam" From 8be841452ec908e25439cd2cc87d7f2826cc0304 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 23:03:46 +0100 Subject: [PATCH 56/76] add auditwheel verbosity --- .github/workflows/python-build-wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 3021759..7bd8b04 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -54,6 +54,8 @@ jobs: ## skip building pypy and musllinux CIBW_SKIP: pp* *muslinux* + CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel repair -v -w {dest_dir} {wheel}' + #PIP_NO_CACHE_DIR: "false" #PIP_NO_BUILD_ISOLATION: "false" #PIP_NO_BINARY: "pysam" From c08f0f104be320bd4e827277d7a7f0efc1bc5f80 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 23:04:59 +0100 Subject: [PATCH 57/76] fix --- .github/workflows/python-build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 7bd8b04..b565553 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,7 +39,7 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-libs -y;" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh2-devel -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam " #--no-binary pysam" From c2bc7f047b55b85c79e71fbce69bc47843ad62b7 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 23:06:50 +0100 Subject: [PATCH 58/76] fix --- .github/workflows/python-build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index b565553..810d4ed 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,7 +39,7 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh2-devel -y;" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam " #--no-binary pysam" From aa6cb4f8091080472dd61d4fca650fe01518f902 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 23:08:41 +0100 Subject: [PATCH 59/76] fix --- .github/workflows/python-build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 810d4ed..304ddad 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -54,7 +54,7 @@ jobs: ## skip building pypy and musllinux CIBW_SKIP: pp* *muslinux* - CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel repair -v -w {dest_dir} {wheel}' + CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel -v repair -w {dest_dir} {wheel}' #PIP_NO_CACHE_DIR: "false" #PIP_NO_BUILD_ISOLATION: "false" From 95cf668ab0b05016a6ee1770b2e19c6cab29f70b Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 23:11:45 +0100 Subject: [PATCH 60/76] drop auditwheel verbosity --- .github/workflows/python-build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 304ddad..0f7b558 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,7 +39,7 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel -y;" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel libnghttp2-devel -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam " #--no-binary pysam" @@ -54,7 +54,7 @@ jobs: ## skip building pypy and musllinux CIBW_SKIP: pp* *muslinux* - CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel -v repair -w {dest_dir} {wheel}' + #CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel -v repair -w {dest_dir} {wheel}' #PIP_NO_CACHE_DIR: "false" #PIP_NO_BUILD_ISOLATION: "false" From f02684e2fe25c2d2c5a3c7f4f158b3d543c9de3d Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Mon, 9 Dec 2024 23:15:30 +0100 Subject: [PATCH 61/76] fix --- .github/workflows/python-build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 0f7b558..abf97bb 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -39,7 +39,7 @@ jobs: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel libnghttp2-devel -y;" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel libnghttp2-devel openssl-libs -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam " #--no-binary pysam" From 8afb599ea93e83150f30893063d28792c587c1da Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 09:07:14 +0100 Subject: [PATCH 62/76] update docs --- README.md | 16 +++++++++------- doc/installation.rst | 14 ++++++++++---- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 53d0cd5..f3ad2e4 100644 --- a/README.md +++ b/README.md @@ -48,25 +48,27 @@ Requirements: - Python 3.x - Python packages `cython`, `pysam`, `bioframe`, `pyyaml`, `numpy`, `scipy`, `pandas` and `click`. -- Command-line utilities `sort` (the Unix version), `bgzip` (shipped with `samtools`) and `samtools`. If available, `pairtools` can compress outputs with `pbgzip` and `lz4`. +- Command-line utilities `sort` (the Unix version), `samtools` and `bgzip` (shipped with `samtools`). If available, `pairtools` can compress outputs with `pbgzip` and `lz4`. For the full list of recommended versions, see [the requirements section in the pyproject.toml](https://github.com/open2c/pairtools/blob/main/pyproject.toml). -We highly recommend using the `conda` package manager to install `pairtools` together with all its dependencies. To get it, you can either install the full [Anaconda](https://www.continuum.io/downloads) Python distribution or just the standalone [conda](http://conda.pydata.org/miniconda.html) package manager. +There are three options for installing pairtools: -With `conda`, you can install `pairtools` and all of its dependencies from the [bioconda](https://bioconda.github.io/index.html) channel. +1. We highly recommend using the `conda` package manager to install `pairtools` together with all its dependencies. To get it, you can either install the full [Anaconda](https://www.continuum.io/downloads) Python distribution or just the standalone [conda](http://conda.pydata.org/miniconda.html) package manager. + +With `conda`, you can install `pairtools` and all of its dependencies from the [bioconda](https://bioconda.github.io/index.html) channel: ```sh -$ conda install -c bioconda -c conda-forge pairtools +$ conda install -c conda-forge -c bioconda pairtools ``` -Alternatively, install non-Python dependencies separately and download `pairtools` with Python dependencies from PyPI using pip: +2. Alternatively, install non-Python dependencies (`sort`, `samtools`, `bgzip`, `pbgzip` and `lz4`) separately and download `pairtools` with Python dependencies from PyPI using pip: ```sh $ pip install pairtools ``` -Finally, for development purposes, build `pairtools` from source via pip's "editable" mode: +3. Finally, when the two options above don't work or when you want to modify `pairtools`, build `pairtools` from source via pip's "editable" mode: ```sh -$ pip install Cython pysam numpy +$ pip install numpy cython pysam $ git clone https://github.com/open2c/pairtools $ cd pairtools $ pip install -e ./ --no-build-isolation diff --git a/doc/installation.rst b/doc/installation.rst index b89b00c..d21d9f3 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -50,11 +50,17 @@ Then, you can compile and install `pairtools` in `the development mode `_, which installs the package without moving it to a system folder and thus allows immediate live-testing any changes in the python code. Please, make sure that you -have `cython` installed! +have `cython` and `pysam` installed! .. code-block:: bash + $ pip install cython pysam numpy $ cd pairtools - $ pip install -e ./ - - + $ pip install -e ./ --no-build-isolation + +A few notes on the installation: + - `pairtools` have to use `--no-build-isolation`, because it extends `pysam` via Cython and + re-compiles it during the build process. When build isolation is enabled, these `pysam` objects + get lost after the build. + - Because of the `--no-build-isolation` flag, build does not install build-requires, so you have to + install `cython`, `pysam` and `numpy` manually before the build. From 82502d7ed97be2baae67e87e8717c6d5e0992c1e Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 09:09:03 +0100 Subject: [PATCH 63/76] fix --- .github/workflows/python-build-wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index abf97bb..147f903 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -38,10 +38,10 @@ jobs: # to supply options, put them in 'env', like: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_BUILD_FRONTEND: "build; args: -n" - CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel libnghttp2-devel openssl-libs -y;" - CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam " - #--no-binary pysam" + CIBW_BUILD_FRONTEND: "build; args: --no-isolation" + CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel -y;" + #CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel libnghttp2-devel -y;" + CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam --no-binary pysam" # skip building 32-bit wheels (i686) CIBW_ARCHS_LINUX: "auto64" From be47431aa7f7e652f72b20b077dd357836b33b1a Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 09:10:05 +0100 Subject: [PATCH 64/76] fix --- .github/workflows/python-build-wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 147f903..03a3765 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -40,6 +40,8 @@ jobs: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_BUILD_FRONTEND: "build; args: --no-isolation" CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel -y;" + + # we have to recompile pysam so that repairwheel can later find various libraries (libssl, libnghttp2, etc) #CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel libnghttp2-devel -y;" CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam --no-binary pysam" From df8c2ad0fe04558e146c13b3e00138ecee7ed5fe Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 09:12:16 +0100 Subject: [PATCH 65/76] update the test action --- .github/workflows/{python-package.yml => python-test.yml} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename .github/workflows/{python-package.yml => python-test.yml} (97%) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-test.yml similarity index 97% rename from .github/workflows/python-package.yml rename to .github/workflows/python-test.yml index de6cc79..c7b02df 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-test.yml @@ -1,8 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Python package - +name: Test build, lint and test on: push: branches: [ master ] From be9409dfdabeee82b4646d57f20a680e030ef1b7 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 09:39:54 +0100 Subject: [PATCH 66/76] fix --- .github/workflows/python-build-wheels.yml | 10 +++---- .github/workflows/python-make-sdist.yml | 24 +++++++++++++++++ setup.py | 32 ++++++++++------------- 3 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/python-make-sdist.yml diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 03a3765..c5f30a6 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -54,7 +54,7 @@ jobs: CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" ## skip building pypy and musllinux - CIBW_SKIP: pp* *muslinux* + CIBW_SKIP: pp* *musllinux* #CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel -v repair -w {dest_dir} {wheel}' @@ -62,7 +62,7 @@ jobs: #PIP_NO_BUILD_ISOLATION: "false" #PIP_NO_BINARY: "pysam" - # - uses: actions/upload-artifact@v4 - # with: - # name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - # path: ./wheelhouse/*.whl \ No newline at end of file + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl \ No newline at end of file diff --git a/.github/workflows/python-make-sdist.yml b/.github/workflows/python-make-sdist.yml new file mode 100644 index 0000000..a6029d9 --- /dev/null +++ b/.github/workflows/python-make-sdist.yml @@ -0,0 +1,24 @@ +name: Make sdist + +on: [workflow_dispatch] + +jobs: + make_sdist: + name: Make SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Optional, use if you use setuptools_scm + submodules: true # Optional, use if you have submodules + + - name: Install dependencies + run: python -m pip install cython numpy pysam + + - name: Build SDist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz \ No newline at end of file diff --git a/setup.py b/setup.py index 5b036e1..761b415 100644 --- a/setup.py +++ b/setup.py @@ -9,17 +9,13 @@ from setuptools import find_packages, setup from setuptools.extension import Extension - try: from Cython.Distutils import build_ext as _build_ext from Cython.Build import cythonize - - HAVE_CYTHON = True except ImportError: - #from setuptools.command.build_ext import build_ext as _build_ext - print('Cython was not found!') raise ImportError('Cython is required to build the extension modules.') + def _read(*parts, **kwargs): filepath = os.path.join(os.path.dirname(__file__), *parts) encoding = kwargs.pop("encoding", "utf-8") @@ -38,7 +34,7 @@ def get_version(): def get_ext_modules(): - ext = ".pyx" if HAVE_CYTHON else ".c" + ext = ".pyx" src_files = glob.glob( #os.path.join(os.path.dirname(__file__), "pairtools", "lib", "*" + ext) os.path.join("pairtools", "lib", "*" + ext) @@ -47,31 +43,31 @@ def get_ext_modules(): ext_modules = [] for src_file in src_files: name = "pairtools.lib." + os.path.splitext(os.path.basename(src_file))[0] - if not "pysam" in name and not "regions" in name: - ext_modules.append(Extension(name, [src_file])) - elif "regions" in name: + + if 'pysam' in name: + import pysam ext_modules.append( Extension( name, [src_file], - language="c++", + extra_link_args=pysam.get_libraries(), + include_dirs=pysam.get_include(), + define_macros=pysam.get_defines(), ) ) - else: - import pysam + elif "regions" in name: ext_modules.append( Extension( name, [src_file], - extra_link_args=pysam.get_libraries(), - include_dirs=pysam.get_include(), - define_macros=pysam.get_defines(), + language="c++", ) ) - if HAVE_CYTHON: - # .pyx to .c - ext_modules = cythonize(ext_modules) # , annotate=True + else: + ext_modules.append(Extension(name, [src_file])) + + ext_modules = cythonize(ext_modules) # , annotate=True return ext_modules From c0b84878bbdb1356a20764e585f21484d54660db Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 10:14:55 +0100 Subject: [PATCH 67/76] update build --- .github/workflows/python-build-wheels.yml | 26 ++++++++++++++++++++--- .github/workflows/python-make-sdist.yml | 24 --------------------- 2 files changed, 23 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/python-make-sdist.yml diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index c5f30a6..5ea4f50 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -3,6 +3,26 @@ name: Build wheels on: [workflow_dispatch] jobs: + make_sdist: + name: Make SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Optional, use if you use setuptools_scm + submodules: true # Optional, use if you have submodules + + - name: Install dependencies + run: python -m pip install cython numpy pysam + + - name: Build SDist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -48,10 +68,10 @@ jobs: # skip building 32-bit wheels (i686) CIBW_ARCHS_LINUX: "auto64" - # use 2_28 to download pysam's wheel instead of compiling it ; - # THAT DIDN'T WORK THOUGH BECAUSE PYSAM DEPENDS ON LIBSSL, LIBNGHTTP2, ETC, WHICH CANNOT BE FOUND + # we could use 2_28 to download pysam's wheel instead of compiling it ; + # HOWEVER THAT DIDN'T WORK BECAUSE PYSAM DEPENDS ON LIBSSL, LIBNGHTTP2, ETC, WHICH CANNOT BE FOUND # SO WE ARE BACK TO COMPILING PYSAM'S WHEEL (no-binary pysam) - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" + # CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" ## skip building pypy and musllinux CIBW_SKIP: pp* *musllinux* diff --git a/.github/workflows/python-make-sdist.yml b/.github/workflows/python-make-sdist.yml deleted file mode 100644 index a6029d9..0000000 --- a/.github/workflows/python-make-sdist.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Make sdist - -on: [workflow_dispatch] - -jobs: - make_sdist: - name: Make SDist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Optional, use if you use setuptools_scm - submodules: true # Optional, use if you have submodules - - - name: Install dependencies - run: python -m pip install cython numpy pysam - - - name: Build SDist - run: pipx run build --sdist - - - uses: actions/upload-artifact@v4 - with: - name: cibw-sdist - path: dist/*.tar.gz \ No newline at end of file From ee9504565049b3f1d4733cb31e9fc8cd1a55eac3 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 10:46:27 +0100 Subject: [PATCH 68/76] change output location --- .github/workflows/python-build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-build-wheels.yml b/.github/workflows/python-build-wheels.yml index 5ea4f50..46c54d3 100644 --- a/.github/workflows/python-build-wheels.yml +++ b/.github/workflows/python-build-wheels.yml @@ -54,7 +54,7 @@ jobs: run: python -m pip install cibuildwheel==2.22.0 - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse + run: python -m cibuildwheel --output-dir dist # to supply options, put them in 'env', like: env: #CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" @@ -85,4 +85,4 @@ jobs: - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl \ No newline at end of file + path: ./dist/*.whl \ No newline at end of file From 0d63ec6a4beb56d74a2034ef02f0c8e3b7afaff3 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 15:28:49 +0100 Subject: [PATCH 69/76] fix a bug in groupby --- pairtools/lib/scaling.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pairtools/lib/scaling.py b/pairtools/lib/scaling.py index 7e89b46..c9a5957 100644 --- a/pairtools/lib/scaling.py +++ b/pairtools/lib/scaling.py @@ -48,12 +48,13 @@ def _to_float(arr_or_scalar): def assign_regs(chroms, pos, regs): - gb_regs = regs.sort_values(["chrom", "start", "end"]).groupby(["chrom"]) + gb_regs = regs.sort_values(["chrom", "start", "end"]).groupby("chrom") regs_dict = { chrom.encode(): regs_per_chrom[["start", "end"]] - .values.flatten() - .astype(np.int64) + .values + .flatten() + .astype(np.int64) for chrom, regs_per_chrom in gb_regs } From 17f2c14cb9bf6c2542a07ee6c7644fbec31f105c Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 15:56:08 +0100 Subject: [PATCH 70/76] test publish action --- .github/workflows/python-publish.yml | 100 ++++++++++++++++++++------- 1 file changed, 75 insertions(+), 25 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 7960deb..0f00507 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -34,35 +34,85 @@ name: Publish Python Package to PyPI on: - release: - types: [published] + # release: + # types: [published] workflow_dispatch: jobs: - Publish: - # prevents this action from running on forks - if: github.repository == 'open2c/pairtools' - + publish_all: + name: Publish wheels and sdist to PyPI + + # if: github.repository == 'open2c/pairtools' + # if: github.event_name == 'release' && github.event.action == 'published' + + # environment: pypi + # permissions: + # id-token: write runs-on: ubuntu-latest - permissions: - id-token: write - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup - uses: actions/setup-python@v5 + - uses: dawidd6/action-download-artifact@v7 with: - python-version: "3.x" - cache: 'pip' # caching pip dependencies + # Required, if the repo is private a Personal Access Token with `repo` scope is needed or GitHub token in a job where the permissions `action` scope set to `read` + #github_token: ${{secrets.GITHUB_TOKEN}} + # Optional, workflow file name or ID + # If not specified, will be inferred from run_id (if run_id is specified), or will be the current workflow + workflow: python-build-wheels.yml + # Optional, the status or conclusion of a completed workflow to search for + # Can be one of a workflow conclusion: + # "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required" + # Or a workflow status: + # "completed", "in_progress", "queued" + # Use the empty string ("") to ignore status or conclusion in the search + workflow_conclusion: success + + # - name: Publish distribution 📦 to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + +# jobs: +# publish_all: +# name: Publish wheels and sdist to PyPI +# needs: [build_wheels, make_sdist] + +# if: github.repository == 'open2c/pairtools' +# #if: github.event_name == 'release' && github.event.action == 'published' + +# environment: pypi +# permissions: +# id-token: write +# runs-on: ubuntu-latest +# steps: +# - uses: actions/download-artifact@v4 +# with: +# pattern: cibw-* +# path: dist +# merge-multiple: true + +# - name: Publish distribution 📦 to PyPI +# uses: pypa/gh-action-pypi-publish@release/v1 + + # Publish: + # prevents this action from running on forks + # if: github.repository == 'open2c/pairtools' + # runs-on: ubuntu-latest + # permissions: + # id-token: write + + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: Setup + # uses: actions/setup-python@v5 + # with: + # python-version: "3.x" + # cache: 'pip' # caching pip dependencies - - name: Install, build - run: | - python -m pip install --upgrade pip wheel setuptools build - python -m pip install --upgrade cython pysam - python -m pip install -r requirements-dev.txt - python -m build - - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + # - name: Install, build + # run: | + # python -m pip install --upgrade pip wheel setuptools build + # python -m pip install --upgrade cython pysam + # python -m pip install -r requirements-dev.txt + # python -m build + + + From 6abc6be44e7c98f7e06007d19a4b21492c78c0cd Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 16:16:03 +0100 Subject: [PATCH 71/76] publishing scripts --- .github/workflows/python-publish-test.yml | 62 +++++++++------- .github/workflows/python-publish.yml | 87 ++--------------------- 2 files changed, 43 insertions(+), 106 deletions(-) diff --git a/.github/workflows/python-publish-test.yml b/.github/workflows/python-publish-test.yml index bc3fd7a..cd8d574 100644 --- a/.github/workflows/python-publish-test.yml +++ b/.github/workflows/python-publish-test.yml @@ -1,32 +1,44 @@ - -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - name: Publish Python Package to Test PyPI on: - release: - types: [prereleased] + # release: + # types: [published] + workflow_dispatch: jobs: - deploy: - + publish_all: + name: Publish wheels and sdist to Test PyPI + + # if: github.event_name == 'release' && github.event.action == 'published' + + environment: testpypi + permissions: + id-token: write runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine cython numpy pysam - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist - twine upload --repository-url https://test.pypi.org/legacy/ dist/* + - uses: dawidd6/action-download-artifact@v7 + with: + # Required, if the repo is private a Personal Access Token with `repo` scope is needed or GitHub token in a job where the permissions `action` scope set to `read` + #github_token: ${{secrets.GITHUB_TOKEN}} + # Optional, workflow file name or ID + # If not specified, will be inferred from run_id (if run_id is specified), or will be the current workflow + workflow: python-build-wheels.yml + # Optional, the status or conclusion of a completed workflow to search for + # Can be one of a workflow conclusion: + # "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required" + # Or a workflow status: + # "completed", "in_progress", "queued" + # Use the empty string ("") to ignore status or conclusion in the search + workflow_conclusion: success + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + + + + + + diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0f00507..460a14d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,36 +1,3 @@ -# # This workflow will upload a Python Package using Twine when a release is created -# # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -# name: Upload Python Package - -# on: -# release: -# types: [created] - -# jobs: -# deploy: - -# runs-on: ubuntu-latest - -# steps: -# - uses: actions/checkout@v2 -# - name: Set up Python -# uses: actions/setup-python@v2 -# with: -# python-version: '3.10' -# - name: Install dependencies -# run: | -# python -m pip install --upgrade pip -# pip install setuptools wheel twine cython pysam numpy -# - name: Build and publish -# env: -# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} -# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} -# run: | -# python setup.py sdist -# twine upload dist/* - - name: Publish Python Package to PyPI on: @@ -40,14 +7,13 @@ on: jobs: publish_all: - name: Publish wheels and sdist to PyPI + name: Publish wheels and sdist to PyPI - # if: github.repository == 'open2c/pairtools' # if: github.event_name == 'release' && github.event.action == 'published' - # environment: pypi - # permissions: - # id-token: write + environment: pypi + permissions: + id-token: write runs-on: ubuntu-latest steps: - uses: dawidd6/action-download-artifact@v7 @@ -65,54 +31,13 @@ jobs: # Use the empty string ("") to ignore status or conclusion in the search workflow_conclusion: success - # - name: Publish distribution 📦 to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 -# jobs: -# publish_all: -# name: Publish wheels and sdist to PyPI -# needs: [build_wheels, make_sdist] - -# if: github.repository == 'open2c/pairtools' -# #if: github.event_name == 'release' && github.event.action == 'published' -# environment: pypi -# permissions: -# id-token: write -# runs-on: ubuntu-latest -# steps: -# - uses: actions/download-artifact@v4 -# with: -# pattern: cibw-* -# path: dist -# merge-multiple: true - -# - name: Publish distribution 📦 to PyPI -# uses: pypa/gh-action-pypi-publish@release/v1 - - # Publish: - # prevents this action from running on forks - # if: github.repository == 'open2c/pairtools' - # runs-on: ubuntu-latest - # permissions: - # id-token: write - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # - name: Setup - # uses: actions/setup-python@v5 - # with: - # python-version: "3.x" - # cache: 'pip' # caching pip dependencies - # - name: Install, build - # run: | - # python -m pip install --upgrade pip wheel setuptools build - # python -m pip install --upgrade cython pysam - # python -m pip install -r requirements-dev.txt - # python -m build From baeede4d6f68e8898e387e68e38b0e115e3c40df Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 16:21:03 +0100 Subject: [PATCH 72/76] update test publish --- .github/workflows/python-publish-test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/python-publish-test.yml b/.github/workflows/python-publish-test.yml index cd8d574..46af087 100644 --- a/.github/workflows/python-publish-test.yml +++ b/.github/workflows/python-publish-test.yml @@ -34,6 +34,13 @@ jobs: - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: + packages-dir: cibw-sdist + repository-url: https://test.pypi.org/legacy/ + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: cibw-wheels-ubuntu-latest-0 repository-url: https://test.pypi.org/legacy/ From d6268d7ed342e9ae477f2249f631b617125cf0fa Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 16:23:05 +0100 Subject: [PATCH 73/76] update publish action --- .github/workflows/python-publish.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 460a14d..26ffeac 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -33,8 +33,13 @@ jobs: - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: cibw-sdist - + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: cibw-wheels-ubuntu-latest-0 From 81b3bcbb4ba4737174c6497ab337089beaa2654b Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 16:36:40 +0100 Subject: [PATCH 74/76] fix readthedoc reqs --- readthedocs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readthedocs.yml b/readthedocs.yml index efff495..2103f9b 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -12,6 +12,7 @@ sphinx: python: install: - - requirements: requirements_doc.txt - method: pip path: . + extra_requirements: + - docs \ No newline at end of file From daa30d4828bf8594c1518470b29f8817a8151470 Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Tue, 10 Dec 2024 20:45:55 +0100 Subject: [PATCH 75/76] bump version --- .github/workflows/python-publish-test.yml | 4 ++-- .github/workflows/python-publish.yml | 4 ++-- pairtools/__init__.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-publish-test.yml b/.github/workflows/python-publish-test.yml index 46af087..66bba74 100644 --- a/.github/workflows/python-publish-test.yml +++ b/.github/workflows/python-publish-test.yml @@ -31,13 +31,13 @@ jobs: # Use the empty string ("") to ignore status or conclusion in the search workflow_conclusion: success - - name: Publish distribution 📦 to PyPI + - name: Publish sdist 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: cibw-sdist repository-url: https://test.pypi.org/legacy/ - - name: Publish distribution 📦 to PyPI + - name: Publish wheels 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: cibw-wheels-ubuntu-latest-0 diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 26ffeac..8967a9f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -31,12 +31,12 @@ jobs: # Use the empty string ("") to ignore status or conclusion in the search workflow_conclusion: success - - name: Publish distribution 📦 to PyPI + - name: Publish sdist 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: cibw-sdist - - name: Publish distribution 📦 to PyPI + - name: Publish wheels 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: cibw-wheels-ubuntu-latest-0 diff --git a/pairtools/__init__.py b/pairtools/__init__.py index e5d3e19..3d0bded 100644 --- a/pairtools/__init__.py +++ b/pairtools/__init__.py @@ -10,6 +10,6 @@ """ -__version__ = "1.1.0" +__version__ = "1.1.1" # from . import lib From 310794a4608da026fda8e830ad30abf6d6297d4e Mon Sep 17 00:00:00 2001 From: Anton Goloborodko Date: Wed, 11 Dec 2024 08:57:28 +0100 Subject: [PATCH 76/76] v1.1.2 --- CHANGES.md | 5 +++++ MANIFEST.in | 8 +++++--- pairtools/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2c2b487..d172be2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +### 1.1.2 (2024-12-11) ### + +Bugfixes: +- Drop Cython-generated .c/.cpp files from the sdist + ### 1.1.1 (2024-12-10) ### Bugfixes: diff --git a/MANIFEST.in b/MANIFEST.in index a27cd4a..3b02136 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,8 +1,8 @@ -include CHANGES.md include README.md -include requirements.txt -include requirements_doc.txt +include CHANGES.md include LICENSE +include pyproject.toml +include pytest.ini graft tests graft doc @@ -11,6 +11,8 @@ prune doc/_templates global-include *.pyx global-include *.pxd +global-exclude *.c +global-exclude *.cpp global-exclude __pycache__/* global-exclude *.so diff --git a/pairtools/__init__.py b/pairtools/__init__.py index 3d0bded..a4336e5 100644 --- a/pairtools/__init__.py +++ b/pairtools/__init__.py @@ -10,6 +10,6 @@ """ -__version__ = "1.1.1" +__version__ = "1.1.2" # from . import lib diff --git a/setup.py b/setup.py index 761b415..a765afe 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from Cython.Distutils import build_ext as _build_ext from Cython.Build import cythonize except ImportError: - raise ImportError('Cython is required to build the extension modules.') + raise ImportError('Cython is now required to build the extension modules.') def _read(*parts, **kwargs):