Added some more package metadata, bumped version in preparation of new release, tweaked setup.py
This commit is contained in:
@@ -54,7 +54,7 @@ install:
|
||||
- sed -i -e 's/^/#/' tests/gnupghome/gpg-agent.conf
|
||||
- ./install_dependencies.${TRAVIS_OS_NAME}.sh
|
||||
# ensure tox and coveralls are installed. pin PyYAML until we drop Python 3.4
|
||||
- pip install tox python-coveralls 'PyYAML==5.2; python_version == "3.4"' 'pathlib2; python_version < "3"'
|
||||
- pip install tox python-coveralls 'PyYAML==5.2; python_version == "3.4"'
|
||||
|
||||
# set TOXENV if it isn't yet
|
||||
before_script:
|
||||
|
||||
@@ -15,4 +15,4 @@ __all__ = ['__author__',
|
||||
__author__ = "Michael Greene"
|
||||
__copyright__ = "Copyright (c) 2014-2019 Security Innovation, Inc"
|
||||
__license__ = "BSD"
|
||||
__version__ = str(LooseVersion("0.5.2"))
|
||||
__version__ = str(LooseVersion("0.5.3"))
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel", "pathlib2 ; python_version < '3'"]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
[metadata]
|
||||
name = PGPy
|
||||
author_email = mgreene@securityinnovation.com
|
||||
maintainer = Security Innovation
|
||||
maintainer_email = opensource@securityinnovation.com
|
||||
description = Pretty Good Privacy for Python
|
||||
keywords = OpenPGP, PGP, Pretty Good Privacy, GPG, GnuPG, openpgp, pgp, gnupg, gpg, encryption, signature
|
||||
url = https://github.com/SecurityInnovation/PGPy
|
||||
@@ -39,7 +41,7 @@ install_requires =
|
||||
setup_requires =
|
||||
setuptools
|
||||
wheel
|
||||
pathlib2 ; python_version < '3'
|
||||
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
|
||||
|
||||
# doc_requires =
|
||||
# sphinx
|
||||
|
||||
38
setup.py
38
setup.py
@@ -1,12 +1,8 @@
|
||||
#!/usr/bin/python3
|
||||
# from distutils.core import setup
|
||||
import ast
|
||||
import os.path
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
try:
|
||||
from pathlib import Path
|
||||
except ImportError:
|
||||
from pathlib2 import Path
|
||||
|
||||
def extract_value(v):
|
||||
if isinstance(v, ast.Str):
|
||||
@@ -19,7 +15,8 @@ def extract_value(v):
|
||||
if r is not None:
|
||||
return r
|
||||
|
||||
def extract_vars_from_python_AST(a):
|
||||
|
||||
def extract_vars_from_python_ast(a):
|
||||
res = {}
|
||||
for e in a.body:
|
||||
if isinstance(e, ast.Assign) and len(e.targets) == 1:
|
||||
@@ -28,17 +25,18 @@ def extract_vars_from_python_AST(a):
|
||||
res[n.id] = extract_value(e.value)
|
||||
return res
|
||||
|
||||
def extract_vars_from_python_source(p):
|
||||
with p.open("rt", encoding="utf-8") as f:
|
||||
t = f.read()
|
||||
return extract_vars_from_python_AST(ast.parse(t))
|
||||
|
||||
if __name__ == "__main__":
|
||||
thisDir = Path(__file__).parent.absolute()
|
||||
authorInfo = extract_vars_from_python_source(Path(thisDir / "pgpy" / "_author.py"))
|
||||
setup(
|
||||
version = authorInfo["__version__"],
|
||||
author = authorInfo["__author__"],
|
||||
license = authorInfo["__license__"],
|
||||
download_url = "https://github.com/SecurityInnovation/PGPy/archive/{pgpy_ver}.tar.gz".format(pgpy_ver=authorInfo["__version__"]),
|
||||
)
|
||||
def extract_vars_from_python_source(p):
|
||||
with open(p) as f:
|
||||
t = f.read()
|
||||
return extract_vars_from_python_ast(ast.parse(t))
|
||||
|
||||
|
||||
this_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
author_info = extract_vars_from_python_source(os.path.join(this_dir, "pgpy", "_author.py"))
|
||||
setup(
|
||||
version=author_info["__version__"],
|
||||
author=author_info["__author__"],
|
||||
license=author_info["__license__"],
|
||||
download_url="https://github.com/SecurityInnovation/PGPy/archive/{pgpy_ver}.tar.gz".format(pgpy_ver=author_info["__version__"]),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user