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