Skip to content

Commit

Permalink
Moved the metadata into setup.cfg
Browse files Browse the repository at this point in the history
Added pyproject.toml
The version is now fetched from git tags.
  • Loading branch information
KOLANICH committed Apr 14, 2021
1 parent 8b4b377 commit bdccb09
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"
20 changes: 20 additions & 0 deletions setup.cfg
@@ -0,0 +1,20 @@
[metadata]
name = simpleeval
author = Daniel Fairhead
author_email = danthedeckie@gmail.com
description = A simple, safe single expression evaluator library.
keywords = eval, simple, expression, parse, ast
url = https://github.com/danthedeckie/simpleeval
long_description = file: README.rst
long_description_content_type = text/x-rst
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Topic :: Software Development :: Libraries :: Python Modules
Programming Language :: Python

[options]
py_modules = simpleeval
use_2to3 = True
setup_requires = setuptools>=30.3.0; wheel; setuptools_scm
43 changes: 21 additions & 22 deletions setup.py 100644 → 100755
@@ -1,25 +1,24 @@
#!/usr/bin/env python3
from os.path import dirname
from os.path import join as pjoin

from setuptools import setup
from setuptools.config import read_configuration

__version__ = '0.9.10'
import setuptools_scm

setup(
name='simpleeval',
py_modules=['simpleeval'],
version=__version__,
description='A simple, safe single expression evaluator library.',
long_description=open('README.rst', 'r').read(),
long_description_content_type='text/x-rst',
author='Daniel Fairhead',
author_email='danthedeckie@gmail.com',
url='https://github.com/danthedeckie/simpleeval',
download_url='https://github.com/danthedeckie/simpleeval/tarball/' + __version__,
keywords=['eval', 'simple', 'expression', 'parse', 'ast'],
test_suite='test_simpleeval',
use_2to3=True,
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python',
],
)
if __name__ == "__main__":
p = dirname(__file__)
setup_dict = read_configuration(pjoin(p, "setup.cfg"))
v = setuptools_scm.version_from_scm(str(p))
__version__ = setuptools_scm.format_version(
v,
version_scheme=setuptools_scm.DEFAULT_VERSION_SCHEME,
local_scheme=setuptools_scm.DEFAULT_LOCAL_SCHEME,
)
setup_dict = {
"version": __version__,
}
if v.exact:
setup_dict["download_url"] = setup_dict["url"] + "/tarball/" + str(v.tag)
setup(**setup_dict)

0 comments on commit bdccb09

Please sign in to comment.