-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f954f80
commit f85a7cc
Showing
11 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# requirements.txt | ||
# Best practices for setup.py vs requirements.txt | ||
# https://caremad.io/posts/2013/07/setup-vs-requirement/ | ||
# https://pip.pypa.io/en/stable/reference/pip_install/#install-index-url | ||
|
||
# enables pip install -r requirements.txt to work with setup.py dependencies | ||
# pull the dependencies from setup.py for keri from pip index | ||
--index-url https://pypi.org/simple/ # pypi base pip index or local pip index | ||
|
||
--editable . # install as editable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#!/usr/bin/env python | ||
# -*- encoding: utf-8 -*- | ||
""" | ||
$ python setup.py register sdist upload | ||
First Time register project on pypi | ||
https://pypi.org/manage/projects/ | ||
More secure to use twine to upload | ||
$ pip3 install twine | ||
$ python3 setup.py sdist | ||
$ twine upload dist/xora-0.0.1.tar.gz | ||
Update sphinx /docs | ||
$ cd /docs | ||
$ sphinx-build -b html source build/html | ||
or | ||
$ sphinx-apidoc -f -o source/ ../src/ | ||
$ make html | ||
Best practices for setup.py and requirements.txt | ||
https://caremad.io/posts/2013/07/setup-vs-requirement/ | ||
""" | ||
|
||
|
||
from glob import glob | ||
from os.path import basename | ||
from os.path import splitext | ||
|
||
from setuptools import find_packages | ||
from setuptools import setup | ||
|
||
|
||
|
||
setup( | ||
name='xora', | ||
version='0.0.1', # also change in src/xora/__init__.py | ||
license='Apache Software License 2.0', | ||
description='XORA: XOR Accumulator', | ||
long_description=("XORA: XORed accumulators or blinded data digests for " | ||
"compact and performant data registries."), | ||
author='Samuel M. Smith', | ||
author_email='[email protected]', | ||
url='https://github.com/WebOfTrust/xora', | ||
packages=find_packages('src'), | ||
package_dir={'': 'src'}, | ||
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')], | ||
include_package_data=True, | ||
zip_safe=False, | ||
classifiers=[ | ||
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
'Development Status :: 3 - Alpha', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Operating System :: Unix', | ||
'Operating System :: POSIX', | ||
'Operating System :: Microsoft :: Windows', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
# uncomment if you test on these interpreters: | ||
#'Programming Language :: Python :: Implementation :: PyPy', | ||
# 'Programming Language :: Python :: Implementation :: IronPython', | ||
# 'Programming Language :: Python :: Implementation :: Jython', | ||
# 'Programming Language :: Python :: Implementation :: Stackless', | ||
'Topic :: Utilities', | ||
], | ||
project_urls={ | ||
'Issue Tracker': 'https://github.com/WebOfTrust/xora/issues', | ||
}, | ||
keywords=[ "secure attribution", | ||
"authentic data", | ||
"discovery", | ||
"resolver", | ||
# eg: 'keyword1', 'keyword2', 'keyword3', | ||
], | ||
python_requires='>=3.9.5', | ||
install_requires=[ | ||
'pysodium>=0.7.9', | ||
], | ||
extras_require={ | ||
# eg: | ||
# 'rst': ['docutils>=0.11'], | ||
# ':python_version=="2.6"': ['argparse'], | ||
}, | ||
tests_require=[ | ||
'coverage>=5.5', | ||
'pytest>=6.2.4', | ||
], | ||
setup_requires=[ | ||
], | ||
entry_points={ | ||
'console_scripts': [ | ||
'xora = xora.cli:main', | ||
'xorad = xora.daemon:main' | ||
] | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- encoding: utf-8 -*- | ||
""" | ||
main package | ||
""" | ||
|
||
__version__ = '0.0.1' # also change in setup.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
""" | ||
main entry package | ||
Entrypoint module, in case you use `python -m xora`. | ||
Why does this file exist, and why __main__? For more info, read: | ||
- https://www.python.org/dev/peps/pep-0338/ | ||
- https://docs.python.org/3/using/cmdline.html#cmdoption-m | ||
""" | ||
|
||
from xora.cli import main | ||
|
||
if __name__ == "__main__": | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
command line | ||
Module that contains the command line app. | ||
Why does this file exist, and why not put this in __main__? | ||
You might be tempted to import things from __main__ later, but that will cause | ||
problems: the code will get executed twice: | ||
- When you run `python -m keri` python will execute | ||
``__main__.py`` as a script. That means there won't be any | ||
``hio.__main__`` in ``sys.modules``. | ||
- When you import __main__ it will get executed again (as a module) because | ||
there's no ``hio.__main__`` in ``sys.modules``. | ||
Also see (1) from http://click.pocoo.org/5/setuptools/#setuptools-integration | ||
""" | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description='Command description.') | ||
parser.add_argument('names', metavar='NAME', nargs=argparse.ZERO_OR_MORE, | ||
help="A name of something.") | ||
|
||
|
||
def main(args=None): | ||
args = parser.parse_args(args=args) | ||
print(args.names) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
daemon | ||
Background Server Daemon | ||
""" | ||
|
||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description='Command description.') | ||
parser.add_argument('names', metavar='NAME', nargs=argparse.ZERO_OR_MORE, | ||
help="A name of something.") | ||
|
||
|
||
def main(args=None): | ||
args = parser.parse_args(args=args) | ||
print(args.names) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- encoding: utf-8 -*- | ||
""" | ||
generic | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
""" | ||
Root pytest module | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
""" | ||
Configure PyTest | ||
Use this module to configure pytest | ||
https://docs.pytest.org/en/latest/pythonpath.html | ||
""" | ||
import os | ||
import pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
""" | ||
pytest module | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- encoding: utf-8 -*- | ||
""" | ||
tests.test_main module | ||
""" | ||
|
||
from xora.cli import main | ||
|
||
|
||
def test_main(): | ||
main([]) | ||
|