Moved the metadata from setup.py to setup.cfg
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"'
|
- pip install tox python-coveralls 'PyYAML==5.2; python_version == "3.4"' 'pathlib2; python_version < "3"'
|
||||||
|
|
||||||
# set TOXENV if it isn't yet
|
# set TOXENV if it isn't yet
|
||||||
before_script:
|
before_script:
|
||||||
|
|||||||
3
pyproject.toml
Normal file
3
pyproject.toml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools", "wheel", "pathlib2 ; python_version < '3'"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
52
setup.cfg
52
setup.cfg
@@ -1,7 +1,55 @@
|
|||||||
|
[metadata]
|
||||||
|
name = PGPy
|
||||||
|
author_email = mgreene@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
|
||||||
|
#bugtrack_url = https://github.com/SecurityInnovation/PGPy/issues",
|
||||||
|
long_description = file: README.rst
|
||||||
|
classifiers =
|
||||||
|
Development Status :: 4 - Beta
|
||||||
|
Operating System :: POSIX :: Linux
|
||||||
|
Operating System :: MacOS :: MacOS X
|
||||||
|
Operating System :: Microsoft :: Windows
|
||||||
|
Intended Audience :: Developers
|
||||||
|
Programming Language :: Python
|
||||||
|
Programming Language :: Python :: 3.7
|
||||||
|
Programming Language :: Python :: 3.6
|
||||||
|
Programming Language :: Python :: 3.5
|
||||||
|
Programming Language :: Python :: 3.4
|
||||||
|
Programming Language :: Python :: 2.7
|
||||||
|
Programming Language :: Python :: Implementation :: CPython
|
||||||
|
Topic :: Security
|
||||||
|
Topic :: Security :: Cryptography
|
||||||
|
Topic :: Software Development :: Libraries
|
||||||
|
Topic :: Software Development :: Libraries :: Python Modules
|
||||||
|
License :: OSI Approved :: BSD License
|
||||||
|
|
||||||
|
[options]
|
||||||
|
packages =
|
||||||
|
pgpy
|
||||||
|
pgpy.packet
|
||||||
|
pgpy.packet.subpackets
|
||||||
|
install_requires =
|
||||||
|
cryptography>=2.6
|
||||||
|
pyasn1
|
||||||
|
six>=1.9.0
|
||||||
|
singledispatch; python_version < '3.4'
|
||||||
|
enum34; python_version < '3.4'
|
||||||
|
setup_requires =
|
||||||
|
setuptools
|
||||||
|
wheel
|
||||||
|
pathlib2 ; python_version < '3'
|
||||||
|
|
||||||
|
# doc_requires =
|
||||||
|
# sphinx
|
||||||
|
# sphinx-better-theme
|
||||||
|
|
||||||
|
|
||||||
[build_sphinx]
|
[build_sphinx]
|
||||||
source-dir = docs/source
|
source-dir = docs/source
|
||||||
build-dir = docs/build
|
build-dir = docs/build
|
||||||
all_files = 1
|
all_files = 1
|
||||||
|
|
||||||
[upload_docs]
|
[upload_docs]
|
||||||
upload-dir = docs/build/html
|
upload-dir = docs/build/html
|
||||||
|
|||||||
122
setup.py
122
setup.py
@@ -1,92 +1,44 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python3
|
||||||
# from distutils.core import setup
|
# from distutils.core import setup
|
||||||
import sys
|
import ast
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
if sys.version_info[:2] >= (3, 3):
|
try:
|
||||||
# on Python 3.3+, we can import a file directly using importlib.machinery.SourceFileLoader
|
from pathlib import Path
|
||||||
import importlib.machinery
|
except ImportError:
|
||||||
_loader = importlib.machinery.SourceFileLoader('_author', 'pgpy/_author.py')
|
from pathlib2 import Path
|
||||||
_author = _loader.load_module()
|
|
||||||
|
|
||||||
else:
|
def extract_value(v):
|
||||||
# on Python 2 and 3.2, importlib.machinery.SourceFileLoader doesn't exist
|
if isinstance(v, ast.Str):
|
||||||
# so we have to use imp to accomplish the same thing
|
return v.s
|
||||||
import imp
|
elif isinstance(v, ast.Num):
|
||||||
_author = imp.load_source('_author', 'pgpy/_author.py')
|
return v.n
|
||||||
|
elif isinstance(v, ast.Call):
|
||||||
|
for a in v.args:
|
||||||
|
r = extract_value(a)
|
||||||
|
if r is not None:
|
||||||
|
return r
|
||||||
|
|
||||||
# long_description is the contents of README.rst
|
def extract_vars_from_python_AST(a):
|
||||||
with open('README.rst') as readme:
|
res = {}
|
||||||
long_desc = readme.read()
|
for e in a.body:
|
||||||
|
if isinstance(e, ast.Assign) and len(e.targets) == 1:
|
||||||
|
n = e.targets[0]
|
||||||
|
if isinstance(n, ast.Name):
|
||||||
|
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))
|
||||||
|
|
||||||
_requires = [
|
if __name__ == "__main__":
|
||||||
'cryptography>=2.6',
|
thisDir = Path(__file__).parent.absolute()
|
||||||
'pyasn1',
|
authorInfo = extract_vars_from_python_source(Path(thisDir / "pgpy" / "_author.py"))
|
||||||
'six>=1.9.0',
|
setup(
|
||||||
]
|
version = authorInfo["__version__"],
|
||||||
|
author = authorInfo["__author__"],
|
||||||
_doc_requires = [
|
license = authorInfo["__license__"],
|
||||||
'sphinx',
|
download_url = "https://github.com/SecurityInnovation/PGPy/archive/{pgpy_ver}.tar.gz".format(pgpy_ver=authorInfo["__version__"]),
|
||||||
'sphinx-better-theme'
|
)
|
||||||
]
|
|
||||||
|
|
||||||
if sys.version_info[:2] < (3, 4):
|
|
||||||
# only depend on enum34 and singledispatch if Python is older than 3.4
|
|
||||||
_requires += ['singledispatch']
|
|
||||||
_requires += ['enum34']
|
|
||||||
|
|
||||||
setup(
|
|
||||||
# metadata
|
|
||||||
name = 'PGPy',
|
|
||||||
version = _author.__version__,
|
|
||||||
description = 'Pretty Good Privacy for Python',
|
|
||||||
long_description = long_desc,
|
|
||||||
author = _author.__author__,
|
|
||||||
author_email = "mgreene@securityinnovation.com",
|
|
||||||
license = _author.__license__,
|
|
||||||
classifiers = ['Development Status :: 4 - Beta',
|
|
||||||
'Operating System :: POSIX :: Linux',
|
|
||||||
'Operating System :: MacOS :: MacOS X',
|
|
||||||
'Operating System :: Microsoft :: Windows',
|
|
||||||
'Intended Audience :: Developers',
|
|
||||||
'Programming Language :: Python',
|
|
||||||
'Programming Language :: Python :: 3.7',
|
|
||||||
'Programming Language :: Python :: 3.6',
|
|
||||||
'Programming Language :: Python :: 3.5',
|
|
||||||
'Programming Language :: Python :: 3.4',
|
|
||||||
'Programming Language :: Python :: 2.7',
|
|
||||||
'Programming Language :: Python :: Implementation :: CPython',
|
|
||||||
'Topic :: Security',
|
|
||||||
'Topic :: Security :: Cryptography',
|
|
||||||
'Topic :: Software Development :: Libraries',
|
|
||||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
||||||
'License :: OSI Approved :: BSD License'],
|
|
||||||
keywords = ["OpenPGP",
|
|
||||||
"PGP",
|
|
||||||
"Pretty Good Privacy",
|
|
||||||
"GPG",
|
|
||||||
"GnuPG",
|
|
||||||
"openpgp",
|
|
||||||
"pgp",
|
|
||||||
"gnupg",
|
|
||||||
"gpg",
|
|
||||||
"encryption",
|
|
||||||
"signature", ],
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
install_requires = _requires,
|
|
||||||
|
|
||||||
# urls
|
|
||||||
url = "https://github.com/SecurityInnovation/PGPy",
|
|
||||||
download_url = "https://github.com/SecurityInnovation/PGPy/archive/{pgpy_ver}.tar.gz".format(pgpy_ver=_author.__version__),
|
|
||||||
# bugtrack_url = "https://github.com/SecurityInnovation/PGPy/issues",
|
|
||||||
|
|
||||||
# package hierarchy
|
|
||||||
packages = [
|
|
||||||
"pgpy",
|
|
||||||
"pgpy.packet",
|
|
||||||
"pgpy.packet.subpackets"
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user