[med-svn] [Git][med-team/pybigwig][upstream] New upstream version 0.3.22+dfsg
Diane Trout (@diane)
gitlab at salsa.debian.org
Sun Jul 30 19:23:47 BST 2023
Diane Trout pushed to branch upstream at Debian Med / pybigwig
Commits:
e6ca1a95 by Diane Trout at 2023-07-30T11:11:06-07:00
New upstream version 0.3.22+dfsg
- - - - -
9 changed files:
- .github/workflows/build.yml
- .github/workflows/pypi.yml
- MANIFEST.in
- README.md
- pyBigWig.h
- pyBigWigTest/test.py
- + pyproject.toml
- setup.cfg
- setup.py
Changes:
=====================================
.github/workflows/build.yml
=====================================
@@ -1,7 +1,9 @@
+name: Test
on: pull_request
+
jobs:
testLinux:
- name: TestLinux
+ name: Test Conda Linux
runs-on: "ubuntu-latest"
defaults:
run:
@@ -17,3 +19,33 @@ jobs:
- run: |
pip install .
nosetests -sv
+
+ test-builds:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout at v3
+ with:
+ fetch-depth: 0
+ - name: Set up Python
+ uses: actions/setup-python at v4
+ with:
+ python-version: '3.7'
+ - name: Install build prerequisites
+ run: |
+ python -m pip install --upgrade build numpy
+ - name: Install cibuildwheel
+ run: |
+ python -m pip install --upgrade cibuildwheel
+ - name: Build wheel(s)
+ run: |
+ python -m cibuildwheel --output-dir wheelhouse
+ - name: Build sdist
+ run: |
+ python -m build --sdist
+ - uses: actions/upload-artifact at v3
+ with:
+ name: pyBigWig-build
+ path: |
+ wheelhouse/*
+ dist/pyBigWig*.tar.gz
=====================================
.github/workflows/pypi.yml
=====================================
@@ -5,33 +5,30 @@ jobs:
name: upload to pypi
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout at v1
- - name: Setup conda
+ - uses: actions/checkout at v3
+ with:
+ fetch-depth: 0
+ - name: Set up Python
+ uses: actions/setup-python at v4
+ with:
+ python-version: '3.7'
+ - name: Install build prerequisites
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
- curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- - name: create env
+ python -m pip install --upgrade twine build cibuildwheel numpy
+ - name: sdist
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
- export PATH=$HOME/miniconda/bin:$PATH
- conda create -n foo -q --yes -c conda-forge -c bioconda python=3.7 twine numpy libcurl curl zlib
- - name: sdist
+ python -m build --sdist
+ - name: wheel
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
- export PATH=$HOME/miniconda/bin:$PATH
- source activate foo
- rm -f dist/*
- python setup.py sdist
+ python -m cibuildwheel --output-dir wheelhouse
- name: upload
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
- export PATH=$HOME/miniconda/bin:$PATH
- source activate foo
twine upload dist/*
+ twine upload wheelhouse/*
=====================================
MANIFEST.in
=====================================
@@ -1,4 +1,2 @@
-include LICENSE.txt README.md *.c *.h setup.py
-include libBigWig/*
-include pyBigWigTest/*
-exclude pyBigWig.egg-info/*
+include *.h
+include **/*.h
=====================================
README.md
=====================================
@@ -213,7 +213,7 @@ If you only need to know where entries are and not their associated values, you
## Add a header to a bigWig file
-If you've opened a file for writing then you'll need to give it a header before you can add any entries. The header contains all of the chromosomes, **in order**, and their sizes. If your chromosome has two chromosomes, chr1 and chr2, of lengths 1 and 1.5 million bases, then the following would add an appropriate header:
+If you've opened a file for writing then you'll need to give it a header before you can add any entries. The header contains all of the chromosomes, **in order**, and their sizes. If your genome has two chromosomes, chr1 and chr2, of lengths 1 and 1.5 million bases, then the following would add an appropriate header:
>>> bw.addHeader([("chr1", 1000000), ("chr2", 1500000)])
=====================================
pyBigWig.h
=====================================
@@ -2,7 +2,7 @@
#include <structmember.h>
#include "bigWig.h"
-#define pyBigWigVersion "0.3.18"
+#define pyBigWigVersion "0.3.22"
typedef struct {
PyObject_HEAD
@@ -131,7 +131,7 @@ Positional arguments:\n\
Keyword arguments:\n\
start: Starting position\n\
end: Ending position\n\
- type: Summary type (mean, min, max, coverage, std), default 'mean'.\n\
+ type: Summary type (mean, min, max, coverage, std, sum), default 'mean'.\n\
nBins: Number of bins into which the range should be divided before\n\
computing summary statistics. The default is 1.\n\
exact: By default, pyBigWig uses the same method as Kent's tools from UCSC\n\
=====================================
pyBigWigTest/test.py
=====================================
@@ -268,18 +268,18 @@ class TestNumpy():
# Type 1, single chrom, multiple starts/values, single span
starts = np.array([200, 210, 220, 230, 240, 250, 260, 270, 280, 290], dtype=np.int64)
values2 = np.array(np.random.random_sample(10), dtype=np.float64)
- bw.addEntries(np.str("1"), starts, span=np.int(8), values=values2)
+ bw.addEntries("1", starts, span=np.int64(8), values=values2)
starts = np.array([300, 310, 320, 330, 340, 350, 360, 370, 380, 390], dtype=np.int64)
values3 = np.array(np.random.random_sample(10), dtype=np.float64)
- bw.addEntries(np.str("1"), starts, span=np.int(8), values=values3)
+ bw.addEntries("1", starts, span=np.int64(8), values=values3)
# Type 2, single chrom/start/span/step, multiple values
values4 = np.array(np.random.random_sample(10), dtype=np.float64)
- bw.addEntries(np.str("1"), np.int(400), span=np.int(8), step=np.int64(2), values=values4)
+ bw.addEntries("1", np.int64(400), span=np.int64(8), step=np.int64(2), values=values4)
values5 = np.array(np.random.random_sample(10), dtype=np.float64)
- bw.addEntries(np.str("1"), np.int(500), span=np.int(8), step=np.int64(2), values=values5)
+ bw.addEntries("1", np.int64(500), span=np.int64(8), step=np.int64(2), values=values5)
bw.close()
=====================================
pyproject.toml
=====================================
@@ -0,0 +1,49 @@
+[build-system]
+build-backend = "setuptools.build_meta"
+requires = ["oldest-supported-numpy", "setuptools", "setuptools-scm"]
+
+[project]
+authors = [{name = "Devon P. Ryan", email = "dryan79 at gmail.com"}]
+classifiers = [
+ "Development Status :: 5 - Production/Stable",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved",
+ "Programming Language :: C",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: Implementation :: CPython",
+ "Operating System :: POSIX",
+ "Operating System :: Unix",
+ "Operating System :: MacOS",
+]
+description = "A package for accessing bigWig files using libBigWig"
+keywords = ["bioinformatics", "bigWig", "bigBed"]
+name = "pyBigWig"
+version = "0.3.22"
+readme = "README.md"
+requires-python = ">=3.7"
+
+[project.license]
+text = "MIT"
+
+[project.urls]
+"Bug Tracker" = "https://github.com/deeptools/pyBigWig/issues"
+"Download" = "https://pypi.python.org/pypi/pyBigWig"
+"Homepage" = "https://github.com/deeptools/pyBigWig"
+
+[tool.setuptools]
+# Override setuptools autodiscovery algorithm
+# Only include package test data/source for wheel distribution
+include-package-data = true
+packages = ["pyBigWigTest"]
+
+# Enable version inference from scm
+[tool.setuptools_scm]
+
+# Target only minimum CPython version 3.7 on linux for wheel build
+[tool.cibuildwheel]
+skip = "pp* cp36-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux_x86_64 *-musllinux_i686"
+
+[tool.cibuildwheel.linux]
+manylinux-x86_64-image = "manylinux2014"
=====================================
setup.cfg
=====================================
@@ -1,2 +1,5 @@
-[metadata]
-description-file = README.md
+# This is required for setuptools to name the wheel with the correct
+# minimum python abi version
+# Commenting this out, since this ends up breaking wheels on anything except python 3.7
+#[bdist_wheel]
+#py-limited-api = cp37
=====================================
setup.py
=====================================
@@ -1,15 +1,10 @@
#!/usr/bin/env python
-from setuptools import setup, Extension, find_packages
+from setuptools import setup, Extension
from distutils import sysconfig
+from pathlib import Path
import subprocess
import glob
import sys
-try:
- from numpy.distutils.misc_util import get_info
- from os.path import dirname
- WITHNUMPY = True
-except:
- WITHNUMPY = False
srcs = [x for x in
glob.glob("libBigWig/*.c")]
@@ -46,13 +41,22 @@ for v in foo:
additional_libs.append(v[2:])
include_dirs = ['libBigWig', sysconfig.get_config_var("INCLUDEPY")]
-if WITHNUMPY is True:
+
+# Add numpy build information if numpy is installed as a package
+try:
+ import numpy
defines.extend([('WITHNUMPY', None), ('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')])
- extra_info = get_info('npymath')
- include_dirs.extend(extra_info['include_dirs'])
- libs.extend(extra_info['libraries'])
- extra_info['library_dirs'].extend(additional_libs)
- additional_libs = extra_info['library_dirs']
+
+ # Ref: https://numpy.org/doc/stable/reference/c-api/coremath.html#linking-against-the-core-math-library-in-an-extension
+ numpy_include_dir = numpy.get_include()
+ numpy_library_dir = str(Path(numpy_include_dir) / '..' / 'lib')
+
+ include_dirs.append(numpy_include_dir)
+ additional_libs.append(numpy_library_dir)
+ libs.append('npymath')
+# Silently ignore a failed import of numpy
+except ImportError:
+ pass
module1 = Extension('pyBigWig',
sources = srcs,
@@ -61,30 +65,6 @@ module1 = Extension('pyBigWig',
define_macros = defines,
include_dirs = include_dirs)
-setup(name = 'pyBigWig',
- version = '0.3.18',
- description = 'A package for accessing bigWig files using libBigWig',
- author = "Devon P. Ryan",
- author_email = "ryan at ie-freiburg.mpg.de",
- url = "https://github.com/dpryan79/pyBigWig",
- download_url = "https://github.com/dpryan79/pyBigWig/tarball/0.3.13",
- keywords = ["bioinformatics", "bigWig", "bigBed"],
- classifier = ["Development Status :: 5 - Production/Stable",
- "Intended Audience :: Developers",
- "License :: OSI Approved",
- "Programming Language :: C",
- "Programming Language :: Python",
- "Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.7",
- "Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.5",
- "Programming Language :: Python :: 3.6",
- "Programming Language :: Python :: 3.7",
- "Programming Language :: Python :: Implementation :: CPython",
- "Operating System :: POSIX",
- "Operating System :: Unix",
- "Operating System :: MacOS"],
- packages = find_packages(),
- include_package_data = True,
- extras_require = {'numpy input': ["numpy"]},
- ext_modules = [module1])
+setup(
+ ext_modules=[module1]
+)
View it on GitLab: https://salsa.debian.org/med-team/pybigwig/-/commit/e6ca1a9560a35bd1f9d449771d3a9783bdd80c6b
--
View it on GitLab: https://salsa.debian.org/med-team/pybigwig/-/commit/e6ca1a9560a35bd1f9d449771d3a9783bdd80c6b
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230730/984f1b00/attachment-0001.htm>
More information about the debian-med-commit
mailing list