Skip to content

Commit

Permalink
Moved the metadata into setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
KOLANICH committed Feb 7, 2020
1 parent b2b0187 commit eb02885
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 75 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ python:
- "3.6"
- "3.7"
- "3.8"

install: pip install -U tox-travis
install:
- pip install -U tox-travis pip setuptools setuptools_scm wheel
- python3 ./setup.py bdist_wheel
- pip install ./dist/*.whl
script: tox
3 changes: 1 addition & 2 deletions parglare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
from parglare.exceptions import ParserInitError, ParseError, GrammarError, \
DisambiguationError


__version__ = "0.12.0"
from .version import __version__
41 changes: 41 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
[metadata]
name = parglare
author = Igor R. Dejanovic
author_email = igorREPLACEWITHDOTdejanovic@gmail.com
license = MIT
description = A pure Python Scannerless LR/GLR parser
keywords = parglare
url = https://github.com/igordejanovic/parglare
long_description = file: README.rst
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: Science/Research
Topic :: Software Development :: Interpreters
Topic :: Software Development :: Compilers
Topic :: Software Development :: Libraries :: Python Modules
License :: OSI Approved :: MIT License
Natural Language :: English
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
Operating System :: OS Independent

[options]
packages = parglare, parglare.tables
zip_safe = False
install_requires = click
include_package_data = True
tests_require = flake8; tox; coverage; coveralls; pytest
package_dir =
parglare = parglare
test_suite = tests
setup_requires = setuptools_scm;

[options.entry_points]
console_scripts = pglr = parglare.cli:pglr

[bumpversion]
current_version = 0.1.0
commit = True
Expand Down
81 changes: 10 additions & 71 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import codecs
import os
from setuptools import setup

VERSIONFILE = "parglare/__init__.py"
VERSION = None
for line in open(VERSIONFILE, "r").readlines():
if line.startswith('__version__'):
VERSION = line.split('"')[1]

if not VERSION:
raise RuntimeError('No version defined in parglare.__init__.py')


README = codecs.open(os.path.join(os.path.dirname(__file__), 'README.rst'),
'r', encoding='utf-8').read()
from pathlib import Path
this_dir = Path(__file__).absolute().parent

if sys.argv[-1].startswith('publish'):
if os.system("pip list | grep wheel"):
Expand All @@ -30,60 +18,11 @@
os.system("twine upload -r test dist/*")
else:
os.system("twine upload dist/*")
print("You probably want to also tag the version now:")
print(" git tag -a {0} -m 'version {0}'".format(VERSION))
print(" git push --tags")
print("You probably want to also tag the version now.")
sys.exit()


setup(
name='parglare',
version=VERSION,
description="A pure Python Scannerless LR/GLR parser",
long_description=README,
author="Igor R. Dejanovic",
author_email='igorREPLACEWITHDOTdejanovic@gmail.com',
url='https://github.com/igordejanovic/parglare',
packages=[
'parglare',
'parglare.tables'
],
package_dir={'parglare':
'parglare'},
include_package_data=True,
install_requires=['click'],
tests_require=[
'flake8',
'tox',
'coverage',
'coveralls',
'pytest',
],
test_suite='tests',
license="MIT license",
zip_safe=False,
keywords='parglare',
entry_points={
'console_scripts': [
'pglr = parglare.cli:pglr'
]
},
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: Science/Research',
'Topic :: Software Development :: Interpreters',
'Topic :: Software Development :: Compilers',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'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',
'Operating System :: OS Independent',
]
)
if __name__ == "__main__":
setup(use_scm_version={
"write_to": str(this_dir / "parglare" / "version.py"),
"write_to_template": '__version__ = "{version}"\n',
})

0 comments on commit eb02885

Please # to comment.