Skip to content

Commit

Permalink
Use Rye instead of Poetry (#2)
Browse files Browse the repository at this point in the history
* switched project to use rye instead of poetry

* updated actions for rye to pin before sync

* updated workflows to remove 3.13

* added maturin as dependency

* renamed module to imghash

* removed python 3.8 support
  • Loading branch information
YannickAlex07 authored Aug 7, 2024
1 parent 4e67332 commit 1723d1a
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 210 deletions.
62 changes: 28 additions & 34 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,74 +13,68 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- name: Install the latest version of rye
uses: eifinger/setup-rye@v4

- name: Pin Python Version
run: rye pin ${{ matrix.python-version }}

- name: Install Dependencies
run: poetry install
run: rye sync

- name: Compile Bindings
run: poetry run maturin develop
run: rye run maturin develop

- name: Run Tests
run: poetry run pytest tests/
run: rye run pytest tests/

lint:
name: Linting
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- name: Install the latest version of rye
uses: eifinger/setup-rye@v4

- name: Pin Python Version
run: rye pin ${{ matrix.python-version }}

- name: Install Dependencies
run: poetry install
run: rye sync

- name: Run Ruff Linter
run: poetry run ruff check -v
run: rye run ruff check -v

format:
name: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4

- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- name: Install the latest version of rye
uses: eifinger/setup-rye@v4

- name: Pin Python Version
run: rye pin ${{ matrix.python-version }}

- name: Install Dependencies
run: poetry install
run: rye sync

- name: Run Ruff Linter
run: poetry run ruff format --check -v
run: rye run ruff format --check -v
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
Expand All @@ -28,6 +26,7 @@ jobs:
- runner: ubuntu-latest
target: ppc64le
python:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand All @@ -42,7 +41,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
args: --release --out dist --interpreter ${{ matrix.python }}
sccache: 'true'
manylinux: auto

Expand All @@ -62,6 +61,7 @@ jobs:
- runner: windows-latest
target: x86
python:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand Down Expand Up @@ -96,6 +96,7 @@ jobs:
- runner: macos-14
target: aarch64
python:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.4
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[lib]
name = "imghashpy"
name = "imghash"
crate-type = ["cdylib"]

[dependencies]
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ To get started add the package to your project:

```shell
pip install imghash
```
```

...
File renamed without changes.
156 changes: 0 additions & 156 deletions poetry.lock

This file was deleted.

33 changes: 21 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
[tool.poetry]
[project]
name = "imghash"
version = "0.1.0"
description = "Image hashing powered by Rust"
description = "Image hashing powered by Rust!"

authors = ["Yannick Alexander <yannick@alexanderdev.io>"]
requires-python = ">=3.9,<3.13"

license = "MIT"
readme = "README.md"
authors = [{ name = "Yannick Alexander", email = "yannick@alexanderdev.io" }]
license = { file = "LICENSE" }

package-mode = false
keywords = ["image", "hashing"]
classifiers = [
"Intended Audience :: Developers",
# Python Versions
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

[tool.poetry.dependencies]
python = ">=3.10,<=3.12"
[project.urls]
repository = "https://github.com/yannickalex07/imghash-py"

[tool.poetry.group.dev.dependencies]
maturin = "^1.5.1"
pytest = "^8.2.0"
ruff = "^0.4.2"
[tool.rye]
managed = true
dev-dependencies = ["pip>=24.2", "pytest>=8.3.2", "ruff>=0.5.6", "maturin~=1.7"]

[build-system]
requires = ["maturin>=1.5,<=2.0"]
requires = ["maturin>=1.2,<2.0"]
build-backend = "maturin"
22 changes: 22 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false
# generate-hashes: false
# universal: false

-e file:.
iniconfig==2.0.0
# via pytest
maturin==1.7.0
packaging==24.1
# via pytest
pip==24.2
pluggy==1.5.0
# via pytest
pytest==8.3.2
ruff==0.5.6
Loading

0 comments on commit 1723d1a

Please sign in to comment.