diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-10-22 12:29:32 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-10-22 12:29:32 -0700 |
commit | 5bce48eb6e09decd6cbf20850b3ff674dbcedba9 (patch) | |
tree | 4870a9a2133c60f34340b24d528c589c0a2116f6 | |
parent | 20d7449787eabf8624fabc74326210c8e852eefe (diff) | |
download | grobid_tei_xml-5bce48eb6e09decd6cbf20850b3ff674dbcedba9.tar.gz grobid_tei_xml-5bce48eb6e09decd6cbf20850b3ff674dbcedba9.zip |
'upload' setup.py comment (for pypi.org)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | setup.py | 39 |
2 files changed, 38 insertions, 2 deletions
@@ -19,6 +19,7 @@ src/build/ Pipfile.lock *.egg-info/ htmlcov/ +dist/ !.flake8 !.gitlab-ci.yml @@ -2,13 +2,45 @@ import setuptools from grobid_tei_xml import __version__ + +class UploadCommand(setuptools.Command): + """Support setup.py upload.""" + + description = 'Build and publish the package.' + user_options = [] + + @staticmethod + def status(s): + """Prints things in bold.""" + print('\033[1m{0}\033[0m'.format(s)) + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + try: + self.status('Removing previous builds...') + rmtree(os.path.join(here, 'dist')) + except OSError: + pass + + self.status('Building Source and Wheel (universal) distribution…') + os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable)) + + self.status('Uploading the package to PyPI via Twine…') + os.system('twine upload dist/*') + + sys.exit() + with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="grobid_tei_xml", version=__version__, - python_requires=">=3.7", author="Bryan Newbold", author_email="bnewbold@archive.org", description="parser and transforms for GROBID-flavor TEI-XML", @@ -21,7 +53,7 @@ with open("README.md", "r") as fh: "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], - python_requires=">=3.8", + python_requires=">=3.7", install_requires=[], extras_require={"dev": [ #"isort", @@ -31,4 +63,7 @@ with open("README.md", "r") as fh: "pytest-cov", "yapf", ],}, + cmdclass={ + 'upload': UploadCommand, + }, ) |