From 4f841028c6d02a2ba9176d46f251b090b3eeea4d Mon Sep 17 00:00:00 2001 From: m0ntzi Date: Wed, 14 Feb 2024 17:50:09 +0200 Subject: [PATCH] added support for apple m1 users --- .github/workflows/build.yml | 27 ++++-- .github/workflows/deploy.yml | 50 +++++++---- Cargo.toml | 11 +-- poetry.lock | 160 +++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 5 files changed, 215 insertions(+), 35 deletions(-) create mode 100644 poetry.lock diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a15c894..63aa8f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,19 @@ name: Build -on: [push, pull_request] +on: + - push + - pull_request jobs: lint: if: github.event_name == 'push' && !startsWith(github.event.ref, 'refs/tags') runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install latest rust uses: actions-rs/toolchain@v1 with: toolchain: stable + profile: minimal override: true components: clippy - name: Lint with clippy @@ -24,17 +27,25 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - os: [ubuntu-latest , macos-latest, windows-latest] + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Run image - uses: abatilo/actions-poetry@v2.0.0 + - name: Install Poetry + uses: abatilo/actions-poetry@v2.1.3 - name: Install Rust uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c339f2e..1950641 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,20 +1,29 @@ name: Deploy on: release: - types: [released] + types: + - released jobs: deploy: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - os: [ubuntu-latest, macos-latest, windows-latest] + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install Rust @@ -23,23 +32,32 @@ jobs: profile: minimal toolchain: stable override: true + - name: Install Cross-compilers (macOS) + if: matrix.os == 'macos-latest' + run: | + rustup target add x86_64-apple-darwin + rustup target add aarch64-apple-darwin - name: Publish Package - if: matrix.os != 'windows-latest' - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: - maturin-version: latest command: publish - manylinux: 2014 - args: --username=__token__ --no-sdist --interpreter=python${{ matrix.python-version }} + args: --username=__token__ ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' && '' || '--no-sdist' }} --interpreter=python${{ !startsWith(matrix.os, 'windows') && matrix.python-version || '' }} env: MATURIN_PASSWORD: ${{ secrets.pypi_password }} - - name: Publish Package - if: matrix.os == 'windows-latest' - uses: messense/maturin-action@v1 + if: matrix.os != 'macos-latest' + - name: Publish macOS (x86_64) Package + if: matrix.os == 'macos-latest' + uses: PyO3/maturin-action@v1 with: - maturin-version: latest command: publish - manylinux: 2014 - args: --username=__token__ --no-sdist --interpreter=python + args: --username=__token__ --interpreter=python${{ matrix.python-version }} --target=x86_64-apple-darwin --no-sdist env: MATURIN_PASSWORD: ${{ secrets.pypi_password }} + - name: Publish macOS (arm64) Package + if: matrix.os == 'macos-latest' + uses: PyO3/maturin-action@v1 + with: + command: publish + args: --username=__token__ --interpreter=python${{ matrix.python-version }} --target=aarch64-apple-darwin --no-sdist + env: + MATURIN_PASSWORD: ${{ secrets.pypi_password }} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 55b6389..9f6b543 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "PyDeduplines" -version = "0.6.0" +version = "0.6.1" authors = ["Gal Ben David "] edition = "2021" description = "Python library for a duplicate lines removal written in Rust" @@ -16,15 +16,6 @@ keywords = [ ] [package.metadata.maturin] -requires-python = ">=3.7" -classifier = [ - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", -] [lib] name = "pydeduplines" diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..bfb2b1e --- /dev/null +++ b/poetry.lock @@ -0,0 +1,160 @@ +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +category = "dev" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" + +[[package]] +name = "exceptiongroup" +version = "1.2.0" +description = "Backport of PEP 654 (exception groups)" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "importlib-metadata" +version = "6.7.0" +description = "Read metadata from Python packages" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] +perf = ["ipython"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-ruff", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +category = "dev" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "maturin" +version = "1.4.0" +description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} + +[package.extras] +zig = ["ziglang (>=0.10.0,<0.11.0)"] +patchelf = ["patchelf"] + +[[package]] +name = "packaging" +version = "23.2" +description = "Core utilities for Python packages" +category = "dev" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "pluggy" +version = "1.2.0" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pytest" +version = "7.4.4" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytest-runner" +version = "6.0.1" +description = "Invoke py.test as distutils command with dependency resolution" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "jaraco.tidelift (>=1.4)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-virtualenv", "types-setuptools", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +category = "dev" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "typing-extensions" +version = "4.7.1" +description = "Backported and Experimental Type Hints for Python 3.7+" +category = "dev" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "zipp" +version = "3.15.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "jaraco.itertools", "jaraco.functools", "more-itertools", "big-o", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "pytest-flake8"] + +[metadata] +lock-version = "1.1" +python-versions = "^3.7" +content-hash = "d3751775f5a48f55874329689185792d15525d44f15678cc3bfeb66b5dea0d3d" + +[metadata.files] +colorama = [] +exceptiongroup = [] +importlib-metadata = [] +iniconfig = [] +maturin = [] +packaging = [] +pluggy = [] +pytest = [] +pytest-runner = [] +tomli = [] +typing-extensions = [] +zipp = [] diff --git a/pyproject.toml b/pyproject.toml index 3c24b6c..152f42c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ sdist-include = [ [tool.poetry] name = "PyDeduplines" -version = "0.6.0" +version = "0.6.1" authors = ["Gal Ben David "] description = "Python library for a duplicate lines removal written in Rust" readme = "README.md"