Migrate to pyproject config
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Luke Murphy 2020-07-07 15:31:26 +02:00
parent 53ce07f1c4
commit db5f71d240
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
11 changed files with 95 additions and 152 deletions

1
.gitignore vendored
View File

@ -9,4 +9,3 @@ __pycache__
build/
dist/
pip-wheel-metadata/
documentation/build/

View File

@ -1,31 +1,23 @@
# hypercore-crypto 0.0.1a4 (UNRELEASED)
# hypercore-crypto 0.0.1a5 (UNRELEASED)
## Removals
# hypercore-crypto 0.0.1a4 (2020-07-07)
- Migration configurations to pyproject
- Follow the Hypercore protocol renaming situation.
- Migrate CI to drone.autonomic.zone
- Migrate to git.autonomic.zone
- Reduce package boilerplate
- Removed RTD documentation
## Trivial/Internal Changes
- Follow the Hypercore protocol renaming situation.
- Migrate to git.autonomic.zone
- Migrate CI to drone.autonomic.zone
- Reduce package boilerplate
# hypercore-crypto 0.0.1a3 (2019-11-14)
## Bug Fixes
- Use the correct keyword argument when invoking `crypto_generichash`.
# hypercore-crypto 0.0.1a2 (2019-11-03)
## Improved Documentation
- New Sphinx theme.
- Add a changelog.
- New Sphinx theme.
# hypercore-crypto 0.0.1a1 (2019-10-05)
## Project Announcements
- The first alpha development release is made!

View File

@ -1 +0,0 @@
include LICENSE README.md CHANGELOG.md

View File

@ -4,6 +4,19 @@
## Cryptography primitives for Hypercore
## Install
```sh
$ pip install hypercore-crypto
```
## Example
```python
from hypercore_crypto import data, key_pair
from pysodium import crypto_sign_PUBLICKEYBYTES
public_key, secret_key = key_pair()
assert len(public_key) == crypto_sign_PUBLICKEYBYTES
print(data(b"hello world").hex())
```

View File

@ -1,9 +1,9 @@
"""hypercore-crypto module."""
from hypercore_crypto.crypto import ( # noqa
from hypercore_crypto.crypto import (
data,
discovery_key,
key_pair,
key_pair, # noqa
leaf,
parent,
random_bytes,
@ -11,14 +11,3 @@ from hypercore_crypto.crypto import ( # noqa
tree,
verify,
)
try:
import pkg_resources
except ImportError:
pass
try:
__version__ = pkg_resources.get_distribution("hypercore_crypto").version
except Exception:
__version__ = "unknown"

View File

@ -1,4 +0,0 @@
[mypy]
python_version = 3.8
platform = linux
ignore_missing_imports = True

View File

@ -1,11 +1,77 @@
[build-system]
requires = [
"setuptools",
"setuptools-scm",
"wheel",
]
build-backend = "setuptools.build_meta"
requires = ["poetry>=1.0.9,<2.0"]
build-backend = "poetry.masonry.api"
[tool.poetry]
name = "hypercore-crypto"
version = "0.0.1a4"
description = "Cryptography primitives for Hypercore"
authors = ["Decentral1se <hi@decentral1.se>"]
maintainers = ["Decentral1se <hi@decentral1.se>"]
license = "GPLv3"
readme = "README.md"
repository = "https://github.com/hyperpy/hypercore-crypto"
keywords = ["hypercore", "hypercore-protocol"]
[tool.poetry.dependencies]
python = "^3.6"
pysodium = "^0.7.5"
merkle-tree-stream = "^0.0.1-alpha.4"
[tool.poetry.dev-dependencies]
black = "^19.10b0"
flake8 = "^3.8.3"
isort = "^5.0.2"
[tool.black]
line-length = 80
target-version = ["py38"]
include = '\.pyi?$'
[tool.isort]
include_trailing_comma = true
known_first_party = "hypercore_crypto"
known_third_party = "pytest"
line_length = 80
multi_line_output = 3
skip = ".venv,.tox"
[tool.tox]
legacy_tox_ini = """
[tox]
envlist =
{py36,py37,py38}
lint
sort
format
type
skip_missing_interpreters = True
isolated_build = True
[testenv]
deps =
pytest
pytest-cov
pytest-mock
commands = pytest test/ --cov={toxinidir}/hypercore_crypto/ --no-cov-on-fail {posargs}
[testenv:lint]
skipdist = True
deps = flake8
commands = flake8 {posargs:--max-line-length 80} hypercore_crypto/ test/
[testenv:sort]
skipdist = True
deps = isort
commands = isort {posargs:-c} -sp setup.cfg hypercore_crypto/ test/
[testenv:format]
skipdist = True
deps = black
commands = black {posargs:--check} hypercore_crypto/ test/
[testenv:type]
skipdist = True
deps = mypy
commands = mypy {posargs:--ignore-missing-imports} hypercore_crypto/ test/
"""

View File

@ -1,49 +0,0 @@
[tool:pytest]
testpaths = test
[flake8]
max-line-length = 80
[isort]
known_first_party = hypercore-crypto
known_third_party = pytest
line_length = 80
multi_line_output = 3
skip = .venv, .tox
include_trailing_comma = True
[metadata]
name = hypercore-crypto
author = decentral1se
author_email = hi@decentral1.se
maintainer = decentral1se
maintainer_email = hi@decentral1.se
url = https://git.autonomic.zone/hyperpy/hypercore-crypto
project_urls =
Source Code = https://git.autonomic.zone/hyperpy/hypercore-crypto
description = Cryptography primitives for Hypercore
long_description = file: README.md
license = GPLv3
license_file = LICENSE
classifiers =
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
[options]
use_scm_version = True
python_requires = >=3.6
setup_requires =
setuptools_scm
setuptools_scm_git_archive
package_dir =
= .
packages = find:
zip_safe = False
install_requires =
pysodium >= 0.7.2, < 0.8
merkle-tree-stream >= 0.0.1a1, < 1.0.0
[options.packages.find]
where = .

View File

@ -1,3 +0,0 @@
from setuptools import setup
setup(use_scm_version=True)

View File

@ -1,10 +0,0 @@
"""Version test module."""
def test_version_fails_gracefully(mocker):
target = "pkg_resources.get_distribution"
mocker.patch(target, side_effect=Exception())
from hypercore_crypto.__init__ import __version__
assert __version__ == "unknown"

49
tox.ini
View File

@ -1,49 +0,0 @@
[tox]
envlist =
{py36,py37,py38}
lint
sort
format
type
docs
skip_missing_interpreters = True
isolated_build = True
[testenv]
deps =
pytest
pytest-cov
pytest-mock
commands =
pytest test/ --cov={toxinidir}/hypercore_crypto/ --no-cov-on-fail {posargs}
[testenv:lint]
skipdist = True
deps = flake8
commands = flake8 {posargs} hypercore_crypto/ test/
[testenv:sort]
skipdist = True
deps = isort
commands = isort {posargs:-rc -c} -sp setup.cfg hypercore_crypto/ test/
[testenv:format]
skipdist = True
deps = black
commands = black {posargs:--check} hypercore_crypto/ test/
[testenv:type]
skipdist = True
deps = mypy
commands = mypy hypercore_crypto/ test/
[testenv:release]
description = make a release
deps = twine
commands =
rm -rf {toxworkdir}/dist
python -m setup sdist --dist-dir {toxworkdir}/dist bdist_wheel
python -m setup sdist --dist-dir {toxworkdir}/dist bdist_egg
twine upload {toxworkdir}/dist/*
whitelist_externals =
rm