[med-svn] [Git][med-team/python-tinyalign][upstream] New upstream version 0.2.2

Lance Lin (@linqigang) gitlab at salsa.debian.org
Thu Sep 7 16:50:13 BST 2023



Lance Lin pushed to branch upstream at Debian Med / python-tinyalign


Commits:
69795224 by Lance Lin at 2023-09-07T21:57:38+07:00
New upstream version 0.2.2
- - - - -


10 changed files:

- .github/workflows/ci.yml
- LICENSE
- − MANIFEST.in
- README.md
- − buildwheels.sh
- pyproject.toml
- setup.py
- + src/tinyalign/_core.pyi
- + src/tinyalign/_version.pyi
- + src/tinyalign/py.typed


Changes:

=====================================
.github/workflows/ci.yml
=====================================
@@ -8,11 +8,11 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
+        python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
     steps:
-    - uses: actions/checkout at v2
+    - uses: actions/checkout at v3
     - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python at v2
+      uses: actions/setup-python at v4
       with:
         python-version: ${{ matrix.python-version }}
     - name: Install dependencies
@@ -28,26 +28,19 @@ jobs:
     needs: [test]
     if: startsWith(github.ref, 'refs/tags')
     steps:
-    - uses: actions/checkout at v2
+    - uses: actions/checkout at v3
       with:
         fetch-depth: 0  # required for setuptools_scm
     - name: Set up Python
-      uses: actions/setup-python at v2
+      uses: actions/setup-python at v4
       with:
-        python-version: 3.7
+        python-version: "3.11"
     - name: Build wheels
-      uses: joerick/cibuildwheel at v2.2.2
+      uses: pypa/cibuildwheel at v2.13
       with:
         output-dir: dist/
       env:
-        CIBW_BUILD: "cp3*-*"
-        CIBW_SKIP: "*-manylinux_i686 *musllinux*"
-        # CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
-        CIBW_ENVIRONMENT: "CFLAGS=-g0"
-        CIBW_TEST_REQUIRES: "pytest"
-        CIBW_TEST_COMMAND: |
-            cd {project}
-            pytest
+        CIBW_BUILD: "cp3*-manylinux_x86_64"
     - name: Make sdist
       run: |
         python -m pip install build
@@ -55,14 +48,14 @@ jobs:
         ls -l dist/
     - name: Publish dev release to test PyPI
       if: contains(github.ref, '.dev')
-      uses: pypa/gh-action-pypi-publish at v1.4.2
+      uses: pypa/gh-action-pypi-publish at v1.8.7
       with:
         user: __token__
         password: ${{ secrets.test_pypi_password }}
         repository_url: https://test.pypi.org/legacy/
     - name: Publish to PyPI
       if: "!contains(github.ref, '.dev')"
-      uses: pypa/gh-action-pypi-publish at v1.4.2
+      uses: pypa/gh-action-pypi-publish at v1.8.7
       with:
         user: __token__
         password: ${{ secrets.pypi_password }}


=====================================
LICENSE
=====================================
@@ -1,4 +1,4 @@
-Copyright (c) 2019-2020 Marcel Martin <marcel.martin at scilifelab.se>
+Copyright (c) 2019 Marcel Martin <marcel.martin at scilifelab.se>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal


=====================================
MANIFEST.in deleted
=====================================
@@ -1,4 +0,0 @@
-include README.md
-include LICENSE
-include src/tinyalign/*.c
-include src/tinyalign/_version.py


=====================================
README.md
=====================================
@@ -29,3 +29,10 @@ length of the shortest string, this module is faster.
 >>> edit_distance("hello", "world", maxdiff=2)
 3
 ```
+
+
+## Changes
+
+### v0.2.2
+
+* Added type hints


=====================================
buildwheels.sh deleted
=====================================
@@ -1,47 +0,0 @@
-#!/bin/bash
-#
-# Build manylinux wheels. Based on the example at
-# <https://github.com/pypa/python-manylinux-demo>
-#
-# It is best to run this in a fresh clone of the repository!
-#
-# Run this within the repository root:
-#   ./buildwheels.sh
-#
-# The wheels will be put into the dist/ subdirectory.
-
-set -xeuo pipefail
-
-manylinux=quay.io/pypa/manylinux2010_x86_64
-
-# For convenience, if this script is called from outside of a docker container,
-# it starts a container and runs itself inside of it.
-if ! grep -q docker /proc/1/cgroup; then
-  # We are not inside a container
-  docker pull ${manylinux}
-  exec docker run --rm -v $(pwd):/io ${manylinux} /io/$0
-fi
-
-if ! test -d /io/dist; then
-  mkdir /io/dist
-  chown --reference=/io/setup.py /io/dist
-fi
-
-# Strip binaries (copied from multibuild)
-STRIP_FLAGS=${STRIP_FLAGS:-"-Wl,-strip-all"}
-export CFLAGS="${CFLAGS:-$STRIP_FLAGS}"
-export CXXFLAGS="${CXXFLAGS:-$STRIP_FLAGS}"
-
-for PYBIN in /opt/python/cp3[678]-*/bin; do
-    ${PYBIN}/pip wheel --no-deps /io/ -w wheelhouse/
-done
-ls wheelhouse/
-
-# Bundle external shared libraries into the wheels
-for whl in wheelhouse/*.whl; do
-    auditwheel repair "$whl" --plat manylinux1_x86_64 -w repaired/
-done
-
-# Created files are owned by root, so fix permissions.
-chown -R --reference=/io/setup.py repaired/
-mv repaired/*.whl /io/dist/


=====================================
pyproject.toml
=====================================
@@ -1,2 +1,37 @@
 [build-system]
-requires = ["setuptools", "wheel", "setuptools_scm", "Cython"]
+requires = ["setuptools >= 63", "setuptools_scm[toml] >= 6.2", "Cython >= 0.29.20"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "tinyalign"
+authors = [
+    {name = "Marcel Martin", email = "marcel.martin at scilifelab.se"}
+]
+description = "Fast banded edit distance"
+readme = "README.md"
+license = {text = "MIT"}
+classifiers = [
+    "Development Status :: 4 - Beta",
+    "Intended Audience :: Science/Research",
+    "License :: OSI Approved :: MIT License",
+    "Natural Language :: English",
+    "Programming Language :: Cython",
+    "Programming Language :: Python :: 3",
+    "Topic :: Scientific/Engineering :: Bio-Informatics",
+]
+requires-python = ">=3.7"
+dynamic = ["version"]
+
+[project.urls]
+"Homepage" = "https://github.com/marcelm/tinyalign/"
+
+[tool.setuptools.exclude-package-data]
+tinyalign = ["*.pyx"]
+
+[tool.setuptools_scm]
+write_to = "src/tinyalign/_version.py"
+
+[tool.cibuildwheel]
+environment = "CFLAGS=-g0"
+test-command = ["cd {project}; pytest"]
+test-requires = "pytest"


=====================================
setup.py
=====================================
@@ -1,82 +1,4 @@
-import sys
-import os.path
-from setuptools import setup, Extension, find_packages
-from distutils.command.sdist import sdist as _sdist
-from distutils.command.build_ext import build_ext as _build_ext
+from setuptools import setup, Extension
+import setuptools_scm  # noqa  Ensure it’s installed
 
-
-def no_cythonize(extensions, **_ignore):
-    """Change .pyx to .c or .cpp (copied from Cython documentation)"""
-    for extension in extensions:
-        sources = []
-        for sfile in extension.sources:
-            path, ext = os.path.splitext(sfile)
-            if ext in (".pyx", ".py"):
-                if extension.language == "c++":
-                    ext = ".cpp"
-                else:
-                    ext = ".c"
-                sfile = path + ext
-            sources.append(sfile)
-        extension.sources[:] = sources
-
-
-extensions = [
-    Extension("tinyalign._core", sources=["src/tinyalign/_core.pyx"]),
-]
-
-
-class BuildExt(_build_ext):
-    def run(self):
-        # If we encounter a PKG-INFO file, then this is likely a .tar.gz/.zip
-        # file retrieved from PyPI that already includes the pre-cythonized
-        # extension modules, and then we do not need to run cythonize().
-        if os.path.exists("PKG-INFO"):
-            no_cythonize(extensions)
-        else:
-            # Otherwise, this is a 'developer copy' of the code, and then the
-            # only sensible thing is to require Cython to be installed.
-            from Cython.Build import cythonize
-
-            self.extensions = cythonize(self.extensions)
-        super().run()
-
-
-class SDist(_sdist):
-    def run(self):
-        # Make sure the compiled Cython files in the distribution are up-to-date
-        from Cython.Build import cythonize
-
-        cythonize(extensions)
-        super().run()
-
-
-with open("README.md", encoding="utf-8") as f:
-    long_description = f.read()
-
-setup(
-    name="tinyalign",
-    setup_requires=["setuptools_scm"],  # Support pip versions that don't know about pyproject.toml
-    use_scm_version={"write_to": "src/tinyalign/_version.py"},
-    author="Marcel Martin",
-    author_email="marcel.martin at scilifelab.se",
-    url="https://github.com/marcelm/tinyalign/",
-    description="Fast banded edit distance",
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    license="MIT",
-    packages=find_packages("src"),
-    package_dir={"": "src"},
-    ext_modules=extensions,
-    cmdclass={"build_ext": BuildExt, "sdist": SDist},
-    python_requires='>=3.6',
-    classifiers=[
-        "Development Status :: 3 - Alpha",
-        "Intended Audience :: Science/Research",
-        "License :: OSI Approved :: MIT License",
-        "Natural Language :: English",
-        "Programming Language :: Cython",
-        "Programming Language :: Python :: 3",
-        "Topic :: Scientific/Engineering :: Bio-Informatics",
-    ],
-)
+setup(ext_modules=[Extension("tinyalign._core", sources=["src/tinyalign/_core.pyx"])])


=====================================
src/tinyalign/_core.pyi
=====================================
@@ -0,0 +1,2 @@
+def edit_distance(s: str, t: str, maxdiff: int = ...) -> int: ...
+def hamming_distance(s: str, t: str) -> int: ...


=====================================
src/tinyalign/_version.pyi
=====================================
@@ -0,0 +1,4 @@
+# The _version.py file is generated on installation. By including this stub,
+# we can run mypy without having to install the package.
+
+version: str


=====================================
src/tinyalign/py.typed
=====================================



View it on GitLab: https://salsa.debian.org/med-team/python-tinyalign/-/commit/697952243d476d6aa756da7b190d94cb70199a5c

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-tinyalign/-/commit/697952243d476d6aa756da7b190d94cb70199a5c
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/20230907/a7053d2d/attachment-0001.htm>


More information about the debian-med-commit mailing list