diff --git a/.gitignore b/.gitignore index 3760e99..abc564e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,12 @@ *.log.* .env* *.pid -dist/ -build/ -*.egg-info +/build +/dist +/*.egg-info/ +/*.eggs/ .sass-cache/ node_modules/ .tox +# Generated by setuptools_scm +graphdash/_version.py diff --git a/graphdash/__init__.py b/graphdash/__init__.py index 913ab12..f553e18 100644 --- a/graphdash/__init__.py +++ b/graphdash/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from .routes import app, CONF +from ._version import __version__ -__all__ = ['app', 'CONF'] +__all__ = ['app', 'CONF', '__version__'] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d5f024a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "graphdash/_version.py" +write_to_template = "__version__ = \"{version}\"\n" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..4d2fc2c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,42 @@ +[metadata] +name = GraphDash +description = A web-based dashboard built from graphs and their metadata +long_description = file: README.rst +long_description_content_type = text/x-rst +url = https://github.com/AmadeusITGroup/graphdash' +author = Alex Prengère +author_email = alex.prengere@amadeus.com +license_files = LICENSE +classifiers = + Development Status :: 5 - Production/Stable + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + +[options] +zip_safe = False +packages = find: +install_requires = + PyYAML + Flask + Markdown + Pygments + stop-words +python_requires = >=3.6.1 +setup_requires = + setuptools_scm +scripts = + GraphDashManage + +[options.package_data] +graphdash = + templates/*.html + assets/css/* + assets/js/* + assets/img/* + +[options.entry_points] +console_scripts = + tfl = tfl.__main__:main + GraphDash = graphdash.__main__:main diff --git a/setup.py b/setup.py index 0e425d9..4ca6776 100644 --- a/setup.py +++ b/setup.py @@ -1,53 +1,5 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Packaging -""" - -from __future__ import with_statement -from setuptools import setup, find_packages - -with open('README.rst') as f: - LONG_DESCRIPTION = f.read() - -with open('LICENSE') as f: - LICENSE = f.read() - -INSTALL_REQUIRES = [ - 'PyYAML', - 'Flask', - 'Markdown', - 'Pygments', - 'stop-words', -] +from setuptools import setup setup( - name='GraphDash', - version='0.10.3', - author='Alex Prengere', - author_email='alexprengere@amadeus.com', - url='https://github.com/AmadeusITGroup/graphdash', - description='A web-based dashboard built on graphs and their metadata.', - long_description=LONG_DESCRIPTION, - license=LICENSE, - packages=find_packages(), - package_data={ - 'graphdash': [ - 'templates/*.html', - 'assets/css/*', - 'assets/js/*', - 'assets/img/*', - ], - }, - zip_safe=False, - install_requires=INSTALL_REQUIRES, - entry_points={ - 'console_scripts': [ - 'GraphDash=graphdash.__main__:main', - ], - }, - scripts=[ - 'GraphDashManage', - ], + use_scm_version=True, ) diff --git a/tox.ini b/tox.ini index 2af782b..9185c89 100644 --- a/tox.ini +++ b/tox.ini @@ -25,3 +25,15 @@ exclude = __pycache__ max-line-length = 100 ignore = E203,E241,E402,W503 + +[testenv:packages] +allowlist_externals = + rm +basepython = python3 +deps = + build + twine +commands = + rm -rf build *.egg-info + python -m build -s -w -o dist + twine check dist/*