From c060cb1dca7fef6699de8286107b75faeb853eac Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Fri, 7 Feb 2020 13:17:41 +0300 Subject: [PATCH] Moved the metadata into setup.cfg --- .ci/travis.sh | 8 +++---- .gitignore | 1 + dev-requirements.txt | 2 ++ plumbum/version.py | 3 --- pyproject.toml | 7 ++++++ setup.cfg | 55 +++++++++++++++++++++++++++++++++++++++++--- setup.py | 44 ++++++----------------------------- 7 files changed, 73 insertions(+), 47 deletions(-) delete mode 100644 plumbum/version.py create mode 100644 pyproject.toml diff --git a/.ci/travis.sh b/.ci/travis.sh index cd3bf088..4b608575 100755 --- a/.ci/travis.sh +++ b/.ci/travis.sh @@ -5,13 +5,13 @@ echo $TRAVIS_PYTHON_VERSION # Listed twice to workaround Python 2.6 if [[ "$(uname -s)" == 'Darwin' ]]; then python$PY3 -m pip install --upgrade pip - python$PY3 -m pip install -r dev-requirements.txt - python$PY3 -m pip install coveralls + python$PY3 -m pip install --upgrade -r dev-requirements.txt + python$PY3 -m pip install --upgrade coveralls python$PY3 -m pip install -e . else pip install --upgrade pip - pip install -r dev-requirements.txt - pip install coveralls + pip install --upgrade -r dev-requirements.txt + pip install --upgrade coveralls pip install -e . fi diff --git a/.gitignore b/.gitignore index ae1c166c..56ade7f2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ __pycache__ .settings/ /dist /plumbum.egg-info +/plumbum/version.py /build *.class *.ropeproject diff --git a/dev-requirements.txt b/dev-requirements.txt index 3e56a7c5..912b77ba 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,6 +5,8 @@ idna<2.8 ; python_version < '2.7' pycparser<2.18 ; python_version < '2.7' paramiko<2.4 ; python_version < '2.7' paramiko ; python_version >= '2.7' +pathlib2 ; python_version < '3' setuptools +setuptools_scm wheel ; python_version >= '2.7' psutil diff --git a/plumbum/version.py b/plumbum/version.py deleted file mode 100644 index 2a01992d..00000000 --- a/plumbum/version.py +++ /dev/null @@ -1,3 +0,0 @@ -version = (1, 6, 8) -version_string = ".".join(map(str, version)) -release_date = "2019.10.30" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..df6f3e16 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.3", "pathlib2; python_version < '3'" ] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "plumbum/version.py" +write_to_template = "__version__ = version_string = \"{version}\"\nversion = tuple(int(n) for n in version_string.split(\".\")[:3])\n" diff --git a/setup.cfg b/setup.cfg index ed8a958e..3da500a4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,54 @@ -[bdist_wheel] -universal = 1 - [metadata] +name = plumbum +author = Tomer Filiba +author_email = tomerfiliba@gmail.com +license = MIT +description = Plumbum: shell combinators library +keywords = + path, + local, + remote, + ssh, + shell, + pipe, + popen, + process, + execution, + color, + cli +url = https://plumbum.readthedocs.io +long_description = file: README.rst +long_description_content_type = text/x-rst license_file = LICENSE +classifiers = + Development Status :: 5 - Production/Stable + License :: OSI Approved :: MIT License + Operating System :: Microsoft :: Windows + Operating System :: POSIX + Programming Language :: Python :: 2.6 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Topic :: Software Development :: Build Tools + Topic :: System :: Systems Administration +platforms = POSIX, Windows +provides = plumbum + +[options] +packages = find: +setup_requires = + setuptools>=42 + wheel + setuptools_scm[toml]>=3.4.3 + pathlib2; python_version < '3' + +[options.package_data] +plumbum.cli = i18n/*/LC_MESSAGES/*.mo + + +[bdist_wheel] +universal = 1 diff --git a/setup.py b/setup.py index 7f390210..d2a0f0db 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,14 @@ #!/usr/bin/env python import os +from setuptools import setup, Command +from datetime import date try: - from setuptools import setup, Command + from pathlib import Path except ImportError: - from distutils.core import setup, Command + from pathlib2 import Path + +HERE = Path(__file__).absolute().parent # Fix for building on non-Windows systems import codecs @@ -15,9 +19,6 @@ func = lambda name, enc=ascii: {True: enc}.get(name=='mbcs') codecs.register(func) -HERE = os.path.dirname(__file__) -exec(open(os.path.join(HERE, "plumbum", "version.py")).read()) - class PyDocs(Command): user_options = [] def initialize_options(self): @@ -52,37 +53,6 @@ def run(self): setup(name = "plumbum", - version = version_string, # @UndefinedVariable - description = "Plumbum: shell combinators library", - author = "Tomer Filiba", - author_email = "tomerfiliba@gmail.com", - license = "MIT", - url = "https://plumbum.readthedocs.io", - packages = ["plumbum", "plumbum.cli", "plumbum.commands", "plumbum.machines", "plumbum.path", "plumbum.fs", "plumbum.colorlib"], - package_data={ - "plumbum.cli":["i18n/*/LC_MESSAGES/*.mo"] - }, - platforms = ["POSIX", "Windows"], - provides = ["plumbum"], - keywords = "path, local, remote, ssh, shell, pipe, popen, process, execution, color, cli", cmdclass = {'test':PyTest, - 'docs':PyDocs}, - long_description = open(os.path.join(HERE, "README.rst"), "r").read(), - classifiers = [ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: MIT License", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Topic :: Software Development :: Build Tools", - "Topic :: System :: Systems Administration", - ], + 'docs':PyDocs} ) -