Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Sourty committed May 26, 2024
1 parent b9feb94 commit 2143ba0
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 46 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/rust.yml

This file was deleted.

112 changes: 99 additions & 13 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "release/*"

jobs:
build:
build-linux:
runs-on: ubuntu-latest

strategy:
Expand All @@ -29,31 +29,117 @@ 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: Rename wheels
run: |
mkdir -p renamed_wheels
for whl in dist/*.whl; do
mv "$whl" "renamed_wheels/$(basename "$whl" | sed 's/linux/manylinux2014/')"
done
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist-manylinux2014-${{ matrix.python-version }}
path: renamed_wheels/*

build-macos:
runs-on: macos-latest

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Rust
run: brew install rust

- name: Install package dependencies
run: pip install setuptools-rust==1.9.0

- name: Install build tools
run: pip install wheel

- name: Build the package
run: python setup.py sdist bdist_wheel

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
name: dist-macos-${{ matrix.python-version }}
path: dist/*

publish:
needs: build
needs: [build-linux, build-macos]
runs-on: ubuntu-latest

steps:
- name: Download artifact
- name: Download Linux artifacts for Python 3.8
uses: actions/download-artifact@v3
with:
name: dist-manylinux2014-3.8
path: dist/linux/3.8

- name: Download Linux artifacts for Python 3.9
uses: actions/download-artifact@v3
with:
name: dist-manylinux2014-3.9
path: dist/linux/3.9

- name: Download Linux artifacts for Python 3.10
uses: actions/download-artifact@v3
with:
name: dist-manylinux2014-3.10
path: dist/linux/3.10

- name: Download Linux artifacts for Python 3.11
uses: actions/download-artifact@v3
with:
name: dist
path: dist
name: dist-manylinux2014-3.11
path: dist/linux/3.11

- name: Download macOS artifacts for Python 3.8
uses: actions/download-artifact@v3
with:
name: dist-macos-3.8
path: dist/macos/3.8

- name: Download macOS artifacts for Python 3.9
uses: actions/download-artifact@v3
with:
name: dist-macos-3.9
path: dist/macos/3.9

- name: Download macOS artifacts for Python 3.10
uses: actions/download-artifact@v3
with:
name: dist-macos-3.10
path: dist/macos/3.10

- name: Download macOS artifacts for Python 3.11
uses: actions/download-artifact@v3
with:
name: dist-macos-3.11
path: dist/macos/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
Expand All @@ -67,4 +153,4 @@ jobs:
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
run: twine upload final_dist/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ __pycache__/
cache/
# C extensions
*.so
test/

# Distribution / packaging
.Python
Expand Down
6 changes: 0 additions & 6 deletions pyprojet.toml

This file was deleted.

6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -15,7 +12,6 @@
version=f"{__version__}",
author="Raphael Sourty",
author_email="[email protected]",
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",
Expand All @@ -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"],
)

0 comments on commit 2143ba0

Please sign in to comment.