Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: pip
- package-ecosystem: uv
directory: "/"
schedule:
interval: monthly
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry
- uses: astral-sh/setup-uv@v9.0.0

- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: poetry
- run: uv build

- name: Upload to pypi
run: |
poetry build
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi "$TEST_PYPI_TOKEN"
poetry config pypi-token.pypi "$PYPI_TOKEN"
poetry publish --dry-run
poetry publish --repository testpypi
poetry publish
- run: uv publish --dry-run

- run: uv publish --publish-url https://test.pypi.org/legacy/
env:
UV_PUBLISH_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}

- run: uv publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry
- uses: astral-sh/setup-uv@v9.0.0

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- run: uv python install ${{ matrix.python-version }}

- run: brew install automake
if: matrix.os == 'macos-latest'

- run: poetry install --with test -E eth
- run: uv sync --locked --all-extras --python ${{ matrix.python-version }}

- name: Lint
run: poetry run ruff check --fix && poetry run ruff format && poetry run ty check
run: |
uv run --locked --all-extras --python ${{ matrix.python-version }} ruff check .
uv run --locked --all-extras --python ${{ matrix.python-version }} ruff format --check .
uv run --locked --all-extras --python ${{ matrix.python-version }} ty check

- name: Run test
run: poetry run pytest -s --cov=ecies tests --cov-report xml
run: uv run --locked --all-extras --python ${{ matrix.python-version }} pytest -s --cov=ecies tests --cov-report xml

- run: ./scripts/ci.sh

Expand All @@ -43,4 +42,4 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- run: poetry build
- run: uv build
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,13 @@ See [DETAILS.md](./DETAILS.md).
## Changelog

See [CHANGELOG.md](./CHANGELOG.md).

## Development

```bash
uv sync --all-extras
uv run pytest -v
uv run ruff check --fix
uv run ruff format
uv run ty check
```
1,238 changes: 0 additions & 1,238 deletions poetry.lock

This file was deleted.

85 changes: 42 additions & 43 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[tool.poetry]
name = "eciespy"
packages = [
{include = "ecies"},
]
version = "0.4.7"
# docs
authors = ["Weiliang Li <to.be.impressive@gmail.com>"]
description = "Elliptic Curve Integrated Encryption Scheme for secp256k1/curve25519 in Python"
license = "MIT"
maintainers = ["Weiliang Li <to.be.impressive@gmail.com>"]
readme = "README.md"
repository = "https://github.com/ecies/py"
# tags
[project]
authors = [{ name = "Weiliang Li", email = "to.be.impressive@gmail.com" }]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: OS Independent",
"Topic :: Security :: Cryptography",
]
dependencies = [
"coincurve>=13,<22",
"pycryptodome>=3.21.0",
"typing-extensions>=4.9.0",
]
description = "Elliptic Curve Integrated Encryption Scheme for secp256k1/curve25519 in Python"
keywords = [
"secp256k1",
"crypto",
Expand All @@ -29,42 +29,41 @@ keywords = [
"ethereum",
"cryptocurrency",
]
# package data
include = ["ecies/py.typed"]

[tool.poetry.dependencies]
python = "^3.9"

# for @deprecated
typing-extensions = ">=4.9.0"

# 3rd party
coincurve = ">=13,<22"
pycryptodome = ">=3.21.0"
license = "MIT"
maintainers = [{ name = "Weiliang Li", email = "to.be.impressive@gmail.com" }]
name = "eciespy"
readme = "README.md"
requires-python = ">=3.9,<4"
version = "0.4.7"

# optional
eth-keys = {version = ">=0.4,<0.8", optional = true}
[project.urls]
Repository = "https://github.com/ecies/py"

[tool.poetry.extras]
eth = ["eth-keys"]
[project.optional-dependencies]
eth = ["eth-keys>=0.4,<0.8"]

[tool.poetry.group.dev.dependencies]
ipython = {version = "^9.7.0", python = "^3.11"}
ruff = "^0.14.5"
ty = "^0.0.1a27"
[project.scripts]
eciespy = "ecies.__main__:main"

eth-typing = "^5.2.1"
[dependency-groups]
dev = [
"eth-typing>=5.2.1,<6",
"ipython>=9.7.0,<10; python_version >= '3.11'",
"pytest>=8.4.2,<9",
"pytest-cov>=6.3.0,<7",
"ruff>=0.14.5,<0.15",
"ty>=0.0.1a27,<0.0.2",
]

[tool.poetry.group.test.dependencies]
pytest = "^8.4.2"
pytest-cov = "^6.3.0"
[build-system]
build-backend = "flit_core.buildapi"
requires = ["flit_core>=3.11,<5"]

[tool.poetry.scripts]
eciespy = "ecies.__main__:main"
[tool.flit.module]
name = "ecies"

[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0"]
[tool.flit.sdist]
exclude = ["ecies/.mypy_cache/"]

[tool.pytest.ini_options]
addopts = "--doctest-modules --cov=ecies --cov-report term:skip-covered"
Expand Down
20 changes: 10 additions & 10 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#!/bin/sh

# test cli
poetry run eciespy -h
uv run eciespy -h

# test encrypt/decrypt
## secp256k1
poetry run eciespy -g
uv run eciespy -g
echo '0x95d3c5e483e9b1d4f5fc8e79b2deaf51362980de62dbb082a9a4257eef653d7d' > sk
echo '0x98afe4f150642cd05cc9d2fa36458ce0a58567daeaf5fde7333ba9b403011140a4e28911fcf83ab1f457a30b4959efc4b9306f514a4c3711a16a80e3b47eb58b' > pk
echo 'hello world 🌍' | poetry run eciespy -e -k pk -O out
poetry run eciespy -d -k sk -D out
echo 'hello world 🌍' | uv run eciespy -e -k pk -O out
uv run eciespy -d -k sk -D out

## x25519
poetry run eciespy -g -c x25519
uv run eciespy -g -c x25519
echo '0xe2bfe58d930bd4cb367498fdf5f3df33967d03a691b565360f6265604503748e' > sk
echo '0x94cb092f6b68b4df6bbb0d5f3de01f95cb89f25e24d6cf89bba34de71d9da74e' > pk
echo 'hello world (x25519) 🌍' | poetry run eciespy -e -k pk -O out -c x25519
poetry run eciespy -d -k sk -D out -c x25519
echo 'hello world (x25519) 🌍' | uv run eciespy -e -k pk -O out -c x25519
uv run eciespy -d -k sk -D out -c x25519

## ed25519
poetry run eciespy -g -c ed25519
uv run eciespy -g -c ed25519
echo '0x94faa19c13ab8dddbd0b0a869473dc35c29790b2dd01923f5aefccfbe3657053' > sk
echo '0x204c4e77a8c506e030f0209fbeca147068c33eef05affd11ea2b04afaaeec74b' > pk
echo 'hello world (ed25519) 🌍' | poetry run eciespy -e -k pk -O out -c ed25519
poetry run eciespy -d -k sk -D out -c ed25519
echo 'hello world (ed25519) 🌍' | uv run eciespy -e -k pk -O out -c ed25519
uv run eciespy -d -k sk -D out -c ed25519

# cleanup
rm sk pk out
Loading
Loading