Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Jun 1, 2024
1 parent 83e5dd3 commit e4d2c6c
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 117 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@
/build
/dist
/site

/src/coincurve/_version.py
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

216 changes: 108 additions & 108 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,172 +1,172 @@
[build-system]
requires = [
'scikit-build-core>=0.9.0',
'hatchling',
'setuptools>=42.0.0',
'cffi>=1.3.0',
'pypkgconf; sys_platform == "win32"',
"scikit-build-core>=0.9.0",
"hatchling",
"setuptools>=42.0.0",
"cffi>=1.3.0",
"pypkgconf; sys_platform == 'win32'",
]
build-backend = 'hatchling.build'
build-backend = "hatchling.build"

[project]
name = 'coincurve'
name = "coincurve"
authors = [
{ name='Ofek Lev', email='[email protected]' },
{ name = "Ofek Lev", email = "[email protected]" },
]
description = 'Cross-platform Python CFFI bindings for libsecp256k1'
keywords = ['secp256k1', 'crypto', 'elliptic curves', 'bitcoin', 'ethereum', 'cryptocurrency']
readme = {"file" = "README.md", "content-type" = "text/markdown"}
requires-python = '>=3.8'
description = "Cross-platform Python CFFI bindings for libsecp256k1"
keywords = ["secp256k1", "crypto", "elliptic curves", "bitcoin", "ethereum", "cryptocurrency"]
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
'asn1crypto',
'cffi>=1.3.0',
"asn1crypto",
"cffi>=1.3.0",
]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'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',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries',
'Topic :: Security :: Cryptography',
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
"Topic :: Security :: Cryptography",
]
dynamic = ['version']
dynamic = ["version"]

[project.optional-dependencies]
dev = [
'coverage',
'pytest',
'pytest-benchmark'
"coverage",
"pytest",
"pytest-benchmark"
]

[project.urls]
Homepage = 'https://github.com/ofek/coincurve'
Documentation = 'https://ofek.dev/coincurve/'
Repository = 'https://github.com/ofek/coincurve'
'Bug Tracker' = 'https://github.com/ofek/coincurve/issues'
Homepage = "https://github.com/ofek/coincurve"
Documentation = "https://ofek.dev/coincurve/"
Repository = "https://github.com/ofek/coincurve"
"Bug Tracker" = "https://github.com/ofek/coincurve/issues"

# --- hatch ---
[tool.hatch.version]
path = 'src/coincurve/__about__.py'
path = "src/coincurve/__about__.py"

[tool.hatch.build.targets.sdist]
ignore-vcs = true
include = [
'src',
'tests',
'README.md',
'LICENSE',
'CHANGELOG.md',
'CMakeLists.txt',
'pyproject.toml',
'setup.cfg',
'setup.py',
'MANIFEST.in',
'cmake',
"src",
"tests",
"README.md",
"LICENSE",
"CHANGELOG.md",
"CMakeLists.txt",
"pyproject.toml",
"setup.cfg",
"setup.py",
"MANIFEST.in",
"cmake",
"cm_*",
]
exclude = [
'/.benchmarks',
'/.conda',
'/.github',
'/.git*',
'/.idea',
'/.tox',
'/.eggs',
"/.benchmarks",
"/.conda",
"/.github",
"/.git*",
"/.idea",
"/.tox",
"/.eggs",
]

[tool.hatch.build.targets.wheel.hooks.scikit-build]
experimental = true
cmake.verbose = true
cmake.build-type = 'Release'
cmake.source-dir = '.'
wheel.py-api = ''
cmake.build-type = "Release"
cmake.source-dir = "."
wheel.py-api = ""
wheel.packages = []
# wheel.install-dir = "hatchling_example"

# --- scikit-build-core ---
[tool.scikit-build.cmake.define]
CMAKE_BUILD_TYPE = 'Release'
CMAKE_BUILD_TYPE = "Release"
# Coincurve build options - This may be better extracted from the ENV by the CMake directly?
PROJECT_IGNORE_SYSTEM_LIB = {env='COINCURVE_IGNORE_SYSTEM_LIB', default='ON'}
PROJECT_CROSS_COMPILE_TARGET = {env='COINCURVE_CROSS_HOST', default=''}
PROJECT_IGNORE_SYSTEM_LIB = { env = "COINCURVE_IGNORE_SYSTEM_LIB", default = "ON" }
PROJECT_CROSS_COMPILE_TARGET = { env = "COINCURVE_CROSS_HOST", default = "" }
# Vendored library: SECP256K1
VENDORED_LIBRARY_CMAKE_TARGET = 'secp256k1'
VENDORED_LIBRARY_PKG_CONFIG = 'libsecp256k1'
VENDORED_LIBRARY_PKG_CONFIG_VERSION = '0.4.1'
VENDORED_UPSTREAM_URL = 'https://github.com/bitcoin-core/secp256k1/archive/'
VENDORED_UPSTREAM_REF = {env='COINCURVE_UPSTREAM_REF', default='1ad5185cd42c0636104129fcc9f6a4bf9c67cc40'}
VENDORED_UPSTREAM_SHA = {env='COINCURVE_UPSTREAM_SHA', default='ba34be4319f505c5766aa80b99cfa696cbb2993bfecf7d7eb8696106c493cb8c'}
VENDORED_LIBRARY_CMAKE_TARGET = "secp256k1"
VENDORED_LIBRARY_PKG_CONFIG = "libsecp256k1"
VENDORED_LIBRARY_PKG_CONFIG_VERSION = "0.4.1"
VENDORED_UPSTREAM_URL = "https://github.com/bitcoin-core/secp256k1/archive/"
VENDORED_UPSTREAM_REF = { env = "COINCURVE_UPSTREAM_REF", default = "1ad5185cd42c0636104129fcc9f6a4bf9c67cc40" }
VENDORED_UPSTREAM_SHA = { env = "COINCURVE_UPSTREAM_SHA", default = "ba34be4319f505c5766aa80b99cfa696cbb2993bfecf7d7eb8696106c493cb8c" }
# SECP256K1 library specific build options
# `VENDORED_OPTION` is reserved prefix for vendored library build options
VENDORED_LIBRARY_OPTION_PREFIX = 'SECP256K1'
VENDORED_OPTION_DISABLE_SHARED = {env='COINCURVE_SECP256K1_STATIC', default='ON'}
VENDORED_OPTION_BUILD_BENCHMARK='OFF'
VENDORED_OPTION_BUILD_TESTS='OFF'
VENDORED_OPTION_BUILD_CTIME_TESTS='OFF'
VENDORED_OPTION_BUILD_EXHAUSTIVE_TESTS='OFF'
VENDORED_OPTION_BUILD_EXAMPLES='OFF'
VENDORED_OPTION_ENABLE_MODULE_ECDH='ON'
VENDORED_OPTION_ENABLE_MODULE_RECOVERY='ON'
VENDORED_OPTION_ENABLE_MODULE_SCHNORRSIG='ON'
VENDORED_OPTION_ENABLE_MODULE_EXTRAKEYS='ON'
VENDORED_OPTION_EXPERIMENTAL='ON'
VENDORED_LIBRARY_OPTION_PREFIX = "SECP256K1"
VENDORED_OPTION_DISABLE_SHARED = { env = "COINCURVE_SECP256K1_STATIC", default = "ON" }
VENDORED_OPTION_BUILD_BENCHMARK = "OFF"
VENDORED_OPTION_BUILD_TESTS = "OFF"
VENDORED_OPTION_BUILD_CTIME_TESTS = "OFF"
VENDORED_OPTION_BUILD_EXHAUSTIVE_TESTS = "OFF"
VENDORED_OPTION_BUILD_EXAMPLES = "OFF"
VENDORED_OPTION_ENABLE_MODULE_ECDH = "ON"
VENDORED_OPTION_ENABLE_MODULE_RECOVERY = "ON"
VENDORED_OPTION_ENABLE_MODULE_SCHNORRSIG = "ON"
VENDORED_OPTION_ENABLE_MODULE_EXTRAKEYS = "ON"
VENDORED_OPTION_EXPERIMENTAL = "ON"
# Vendored library build options (cmake, compiler, linker, etc.)
# VENDORED_CMAKE is reserved prefix for vendored library cmake options
# VENDORED_CMAKE_<STATIC|SHARED>_<CMAKE_OPTION> = <VALUE>
VENDORED_LIBRARY_STATIC_BUILD = {env='COINCURVE_SECP256K1_STATIC', default='ON'}
VENDORED_LIBRARY_STATIC_BUILD = { env = "COINCURVE_SECP256K1_STATIC", default = "ON" }

# --- Coverage ---
[tool.coverage.run]
branch = true
source = [
'src/coincurve',
'tests',
"src/coincurve",
"tests",
]
omit = [
'*/_version.py',
'*/test_bench.py',
"*/_version.py",
"*/test_bench.py",
]

[tool.coverage.report]
exclude_lines =[
'no cov',
'no qa',
"no cov",
"no qa",

# Ignore missing debug-only code
'def __repr__',
'if self\.debug',
"def __repr__",
"if self\\.debug",

# Ignore non-runnable code
'if __name__ == .__main__.:',
"if __name__ == .__main__.:",
]

[tool.coverage.paths]
source = [
'src/coincurve',
'.tox/*/lib/python*/site-packages/coincurve',
'.tox/pypy*/site-packages/coincurve',
"src/coincurve",
".tox/*/lib/python*/site-packages/coincurve",
".tox/pypy*/site-packages/coincurve",
]

# --- Pytest ---
[tool.pytest.ini_options]
addopts = [
'--import-mode=importlib',
"--import-mode=importlib",
]

# --- Black ---
[tool.black]
target-version = ['py38']
target-version = ["py38"]
line-length = 120
skip-string-normalization = true
exclude = '''
Expand All @@ -184,32 +184,32 @@ exclude = '''

# --- Ruff ---
[tool.ruff]
target-version = 'py38'
target-version = "py38"
line-length = 120
lint.select = ['A', 'B', 'C', 'E', 'F', 'I', 'M', 'N', 'Q', 'RUF', 'S', 'T', 'U', 'W', 'YTT']
lint.select = ["A", "B", "C", "E", "F", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
lint.ignore = [
# Allow non-abstract empty methods in abstract base classes
'B027',
"B027",
# Ignore McCabe complexity
'C901',
"C901",
# Allow boolean positional values in function calls, like `dict.get(... True)`
'FBT003',
"FBT003",
# Ignore checks for possible passwords
'S105', 'S106', 'S107',
"S105", "S106", "S107",
]
lint.unfixable = [
# Don't touch unused imports
'F401',
"F401",
]
extend-exclude = [
'tests/conftest.py',
"tests/conftest.py",
]

[tool.ruff.lint.isort]
known-first-party = ['coincurve']
known-first-party = ["coincurve"]

[tool.ruff.lint.flake8-quotes]
inline-quotes = 'single'
inline-quotes = "single"

[tool.ruff.lint.per-file-ignores]
# Tests can use assertions
Expand All @@ -219,7 +219,7 @@ inline-quotes = 'single'
# --- Mypy ---
[tool.mypy]
disallow_untyped_defs = false
follow_imports = 'normal'
follow_imports = "normal"
ignore_missing_imports = true
pretty = true
show_column_numbers = true
Expand Down

0 comments on commit e4d2c6c

Please sign in to comment.