From 7b6449b183c3d26540e87384dd59fe3d4bbb59d2 Mon Sep 17 00:00:00 2001 From: Raphael Sourty Date: Sun, 26 May 2024 02:25:01 +0200 Subject: [PATCH] update ci --- .github/workflows/rust.yml | 22 --------------- .github/workflows/wheels.yml | 52 ++++++++++++++++++++++++++++-------- .gitignore | 1 + pyprojet.toml | 6 ----- setup.py | 6 +---- 5 files changed, 43 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/rust.yml delete mode 100644 pyprojet.toml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 84ce1ce..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Rust - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose \ No newline at end of file diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7b7f093..e65780c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -29,19 +29,28 @@ jobs: toolchain: stable override: true - - name: Install build dependencies - run: pip install setuptools-rust + - name: Install package dependencies + run: pip install setuptools-rust==1.9.0 - - name: Build wheel - run: pip wheel . + - name: Install build tools + run: pip install wheel - - name: Create source distribution - run: python setup.py sdist + - name: Build the package + run: python setup.py sdist bdist_wheel + + - name: Install auditwheel + run: pip install auditwheel + + - name: Repair wheels with auditwheel + run: | + for whl in dist/*.whl; do + auditwheel repair "$whl" -w dist/ + done - name: Upload artifacts uses: actions/upload-artifact@v3 with: - name: dist + name: dist-${{ matrix.python-version }} path: dist/* publish: @@ -49,11 +58,32 @@ jobs: runs-on: ubuntu-latest steps: - - name: Download artifact + - name: Download artifacts for Python 3.8 + uses: actions/download-artifact@v3 + with: + name: dist-3.8 + path: dist/3.8 + + - name: Download artifacts for Python 3.9 + uses: actions/download-artifact@v3 + with: + name: dist-3.9 + path: dist/3.9 + + - name: Download artifacts for Python 3.10 + uses: actions/download-artifact@v3 + with: + name: dist-3.10 + path: dist/3.10 + + - name: Download artifacts for Python 3.11 uses: actions/download-artifact@v3 with: - name: dist - path: dist + name: dist-3.11 + path: dist/3.11 + + - name: Combine all artifacts + run: mkdir -p final_dist && find dist/ -type f -exec cp {} final_dist/ \; - name: Set up Python 3.11 uses: actions/setup-python@v4 @@ -67,4 +97,4 @@ jobs: env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: twine upload dist/* + run: twine upload final_dist/* diff --git a/.gitignore b/.gitignore index e1665a9..eb9313f 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ __pycache__/ cache/ # C extensions *.so +test/ # Distribution / packaging .Python diff --git a/pyprojet.toml b/pyprojet.toml deleted file mode 100644 index d63a5c6..0000000 --- a/pyprojet.toml +++ /dev/null @@ -1,6 +0,0 @@ -[build-system] -requires = ["maturin>=1.0,<2.0", ] -build-backend = "maturin" - -[[tool.setuptools-rust.ext-modules]] -target = "rslenlp" \ No newline at end of file diff --git a/setup.py b/setup.py index 258be55..c929aee 100644 --- a/setup.py +++ b/setup.py @@ -3,9 +3,6 @@ from lenlp.__version__ import __version__ -with open("readme.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - base_packages = ["scikit-learn >= 1.5.0", "scipy >= 1.13.1"] dev = ["maturin >= 1.5.1", "pytest-cov >= 5.0.0", "pytest >= 7.4.4", "ruff >= 0.1.15"] @@ -15,7 +12,6 @@ version=f"{__version__}", author="Raphael Sourty", author_email="raphael.sourty@gmail.com", - long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/raphaelsty/lenlp", download_url="https://github.com/raphaelsty/lenlp/archive/v_01.tar.gz", @@ -30,5 +26,5 @@ ], python_requires=">=3.8", rust_extensions=[RustExtension("rslenlp", binding=Binding.PyO3)], - setup_requires=["setuptools-rust>=1.4.0", "maturin >= 1.5.1"], + setup_requires=["setuptools-rust>=1.9.0"], )