This commit is contained in:
parent
53ce07f1c4
commit
db5f71d240
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,4 +9,3 @@ __pycache__
|
||||
build/
|
||||
dist/
|
||||
pip-wheel-metadata/
|
||||
documentation/build/
|
||||
|
24
CHANGELOG.md
24
CHANGELOG.md
@ -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!
|
||||
|
@ -1 +0,0 @@
|
||||
include LICENSE README.md CHANGELOG.md
|
13
README.md
13
README.md
@ -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())
|
||||
```
|
||||
|
@ -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"
|
||||
|
4
mypy.ini
4
mypy.ini
@ -1,4 +0,0 @@
|
||||
[mypy]
|
||||
python_version = 3.8
|
||||
platform = linux
|
||||
ignore_missing_imports = True
|
@ -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/
|
||||
"""
|
||||
|
49
setup.cfg
49
setup.cfg
@ -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 = .
|
@ -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
49
tox.ini
@ -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
|
Loading…
Reference in New Issue
Block a user