From ea7506d07d2d5d8d4e8265eff4452e58eaed8cb3 Mon Sep 17 00:00:00 2001 From: rathaROG Date: Wed, 19 Jul 2023 00:58:18 +0200 Subject: [PATCH] Ready to release v0.5.3 --- .github/workflows/build_pypi.yaml | 35 --------- .github/workflows/cibuildwheel.yaml | 29 ------- .github/workflows/prepublish.yaml | 57 ++++++++++++++ .github/workflows/publish.yaml | 76 +++++++++++++++++++ .../{build_and_test.yaml => test.yaml} | 9 ++- MANIFEST.in | 4 +- README.md | 20 ++--- lap/__init__.py | 2 +- pyproject.toml | 2 +- setup.py | 8 +- 10 files changed, 157 insertions(+), 85 deletions(-) delete mode 100644 .github/workflows/build_pypi.yaml delete mode 100644 .github/workflows/cibuildwheel.yaml create mode 100644 .github/workflows/prepublish.yaml create mode 100644 .github/workflows/publish.yaml rename .github/workflows/{build_and_test.yaml => test.yaml} (92%) diff --git a/.github/workflows/build_pypi.yaml b/.github/workflows/build_pypi.yaml deleted file mode 100644 index e610e14..0000000 --- a/.github/workflows/build_pypi.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build PyPI -on: - push: - tags: - - "v*" -jobs: - build_and_publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.x - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - name: Install requirements - run: | - python -m pip install --upgrade pip - pip install "setuptools>=67.2.0" - pip install wheel build - - name: Build - run: | - python -m build --sdist - cd dist - pip install *.tar.gz - - name: Publish 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.MY_PYPI_API_TOKEN_2023_06_22 }} - - name: Archive Wheels in dist/*.whl - uses: actions/upload-artifact@v3 - with: - name: dist-wheels-all - path: | - dist - !dist/**/*.md diff --git a/.github/workflows/cibuildwheel.yaml b/.github/workflows/cibuildwheel.yaml deleted file mode 100644 index 06492fa..0000000 --- a/.github/workflows/cibuildwheel.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: cibuildwheel -on: [workflow_dispatch] -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: ["windows-latest", "ubuntu-latest", "macos-latest"] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - name: Install cibuildwheel - run: | - python -m pip install --upgrade pip - python -m pip install cibuildwheel==2.14.1 - - name: Build wheels - run: | - python -m cibuildwheel --output-dir wheelhouse - env: - # Build only CPython [3.7-3.11] on all platforms - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-*" - CIBW_ARCHS_WINDOWS: "AMD64" - CIBW_ARCHS_LINUX: "x86_64" - CIBW_ARCHS_MACOS: "x86_64 universal2" - - uses: actions/upload-artifact@v3 - with: - name: dist-wheels-all - path: ./wheelhouse/*.whl diff --git a/.github/workflows/prepublish.yaml b/.github/workflows/prepublish.yaml new file mode 100644 index 0000000..c6d0bcc --- /dev/null +++ b/.github/workflows/prepublish.yaml @@ -0,0 +1,57 @@ +name: Test PyPI Build + +on: [workflow_dispatch] + +jobs: + + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["windows-latest", "ubuntu-latest", "macos-latest"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.14.1 + - name: Build wheels + run: | + python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-*" + CIBW_SKIP: "*-win32 *-manylinux_i686 *-manylinux_2_5" + CIBW_ARCHS_WINDOWS: "AMD64" + CIBW_ARCHS_LINUX: "x86_64" + CIBW_ARCHS_MACOS: "x86_64 universal2" + - name: Archive wheels + uses: actions/upload-artifact@v3 + with: + name: pre-release-wheels + path: ./wheelhouse/*.whl + + build_source: + name: Build source distribution .tar.gz + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.x + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install requirements + run: | + python -m pip install --upgrade pip + pip install "setuptools>=67.2.0" + pip install wheel build + - name: Build .tar.gz + run: | + python -m build --sdist + - name: Archive .tar.gz + uses: actions/upload-artifact@v3 + with: + name: pre-release-wheels + path: dist/*.tar.gz diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..2f265d8 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,76 @@ +name: Publish to PyPI + +on: + push: + tags: + - "v*" + +jobs: + + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["windows-latest", "ubuntu-latest", "macos-latest"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.14.1 + - name: Build wheels + run: | + python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-*" + CIBW_SKIP: "*-win32 *-manylinux_i686 *-manylinux_2_5" + CIBW_ARCHS_WINDOWS: "AMD64" + CIBW_ARCHS_LINUX: "x86_64" + CIBW_ARCHS_MACOS: "x86_64 universal2" + - name: Archive wheels + uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + build_source: + name: Build source distribution .tar.gz + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.x + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install requirements + run: | + python -m pip install --upgrade pip + pip install "setuptools>=67.2.0" + pip install wheel build + - name: Build .tar.gz + run: | + python -m build --sdist + - name: Archive .tar.gz + uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + publish_pypi: + name: Publish to PyPI + needs: [build_wheels, build_source] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - name: Collect and extract artifact + uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.MY_PYPI_API_TOKEN_2023_06_22 }} diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/test.yaml similarity index 92% rename from .github/workflows/build_and_test.yaml rename to .github/workflows/test.yaml index a4f08bd..cb7cb4e 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,7 @@ -name: Build and Test +name: Test Simple + on: [workflow_dispatch] + jobs: build_and_test: name: "${{ matrix.os }} + python ${{ matrix.python-version }}" @@ -33,7 +35,6 @@ jobs: - name: Archive wheels uses: actions/upload-artifact@v3 with: - name: dist-wheels-all + name: test-wheels path: | - dist - !dist/**/*.md + dist/*.whl diff --git a/MANIFEST.in b/MANIFEST.in index d0f5962..026398c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,4 +4,6 @@ recursive-include lap * recursive-include lap/tests * exclude lap/_lapjv.cpp global-exclude */__pycache__ -global-exclude *.pyc \ No newline at end of file +global-exclude *.pyc +prune .github +prune .githubtest \ No newline at end of file diff --git a/README.md b/README.md index d9f45ad..83616fb 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@ -[![Build and Test](https://github.com/rathaROG/lapx/actions/workflows/build_and_test.yaml/badge.svg)](https://github.com/rathaROG/lapx/actions/workflows/build_and_test.yaml) -[![Build PyPI](https://github.com/rathaROG/lapx/actions/workflows/build_pypi.yaml/badge.svg)](https://github.com/rathaROG/lapx/actions/workflows/build_pypi.yaml) +[![Test Simple](https://github.com/rathaROG/lapx/actions/workflows/test.yaml/badge.svg)](https://github.com/rathaROG/lapx/actions/workflows/test.yaml) +[![Test PyPI Build](https://github.com/rathaROG/lapx/actions/workflows/prepublish.yaml/badge.svg)](https://github.com/rathaROG/lapx/actions/workflows/prepublish.yaml) +[![Publish to PyPI](https://github.com/rathaROG/lapx/actions/workflows/publish.yaml/badge.svg)](https://github.com/rathaROG/lapx/actions/workflows/publish.yaml) # Linear Assignment Problem Solver -* `lapx` is a customized edition of Tomas Kazmar's [`gatagat/lap`](https://github.com/gatagat/lap). -* License: BSD-2-Clause, see [`LICENSE`](LICENSE). -* Source code and credit: [lap05-0.5.1.tar.gz](https://files.pythonhosted.org/packages/05/71/5531017a60f5028c87ce34514f2b55d35a2999f6c6e587d1f56e6ee78b10/lap05-0.5.1.tar.gz) @[`gatagat`](https://github.com/gatagat) @[`remram44`](https://github.com/gatagat/lap/issues/34#issue-1114097201). +`lapx` basically is Tomas Kazmar's [`gatagat/lap`](https://github.com/gatagat/lap) with support for all Windows/Linux/macOS and Python 3.7/3.8/3.9/3.10/3.11. +* License: BSD-2-Clause, see [`LICENSE`](LICENSE) +* Based source code : [lap05-0.5.1.tar.gz](https://files.pythonhosted.org/packages/05/71/5531017a60f5028c87ce34514f2b55d35a2999f6c6e587d1f56e6ee78b10/lap05-0.5.1.tar.gz) +* Credits: @[`gatagat`](https://github.com/gatagat) @[`remram44`](https://github.com/gatagat/lap/issues/34#issue-1114097201) -## Windows ✅ | Linux ✅ | macOS ✅ +## Installation: Windows ✅ | Linux ✅ | macOS ✅ -* Build passed on all [Windows/Linux/macOS](https://github.com/rathaROG/lapx/actions/workflows/build_and_test.yaml) with Python 3.7/3.8/3.9/3.10/3.11 ✅ - -* Install `tar.gz` or wheels from [GitHub releases](https://github.com/rathaROG/lapx/releases) or [PyPI](https://pypi.org/project/lapx/): +* Install from [PyPI](https://pypi.org/project/lapx/): ``` pip install lapx ``` -* Or directly install from GitHub repo: +* Or install `.tar.gz` or `.whl` from [GitHub releases](https://github.com/rathaROG/lapx/releases) or install from GitHub repo: ``` pip install git+https://github.com/rathaROG/lapx.git diff --git a/lap/__init__.py b/lap/__init__.py index 7f286e9..0fd21e8 100644 --- a/lap/__init__.py +++ b/lap/__init__.py @@ -13,7 +13,7 @@ import sys -__version__ = '0.5.2.post1' +__version__ = '0.5.3' try: __LAP_SETUP__ diff --git a/pyproject.toml b/pyproject.toml index e090e72..2c054f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] requires = ["setuptools>=67.2.0", "Cython>=0.29.32", "numpy>=1.21.6"] -build-backend = "setuptools.build_meta" +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.py b/setup.py index 8fd9faa..4cf50d1 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ # # # # # # # # # # # # # # # # # # # # # # -# Rewrite on 2023/06/24 by rathaROG # +# Rewrote on 2023/06/24 by rathaROG # +# Updated on 2023/07/19 by rathaROG # # # # # # # # # # # # # # # # # # # # # # # @@ -9,7 +10,7 @@ ################################################################### -DESCRIPTION = "Customized Tomas Kazmar's lap, Linear Assignment Problem solver (LAPJV/LAPMOD)." +DESCRIPTION = "Linear Assignment Problem solver (LAPJV/LAPMOD)." LICENSE = 'BSD-2-Clause' LONG_DESCRIPTION = open("README.md", encoding="utf-8").read() @@ -66,7 +67,6 @@ def run(self): def main_setup(): """Use modern setup() """ - import os from Cython.Build import cythonize _lapjvpyx = os.path.join(_lapjv, '_lapjv.pyx') @@ -124,7 +124,7 @@ def main_setup(): 'Operating System :: Unix', 'Operating System :: MacOS',], ext_modules=cythonize(ext_modules), - cmdclass={'ccythonize': ExportCythonCommand,}, + cmdclass={'cmdexport': ExportCythonCommand,}, ) def read_requirments():