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.
Version is fetched from git tags.
  • Loading branch information
KOLANICH committed Jan 28, 2021
1 parent 10e6959 commit e4e63d1
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 67 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ var/
.installed.cfg
*.egg

# generated by setuptools_scm
/src/cpip/__version__.py

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/cpip/__version__.py"
write_to_template = "__version__ = '{version}'\n"
45 changes: 44 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
[metadata]
name = cpip
version = 0.9.8rc0
author = Paul Ross
author_email = [email protected]
license = GPL-2.0-or-later
description = CPIP is a C/C++ Preprocessor implemented in Python.
keywords = cpip
url = https://github.com/paulross/cpip
long_description = file: README.rst, HISTORY.rst
long_description_content_type = text/x-rst
classifiers =
Development Status :: 4 - Beta
Environment :: Console
Intended Audience :: Developers
License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Natural Language :: English
Programming Language :: Python :: 2
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Operating System :: OS Independent

[options]
packages = find:
zip_safe = False
include_package_data = True
tests_require = pytest, pytest-runner
package_dir =
= src

[options.packages.find]
where = src
include = cpip

[options.entry_points]
console_scripts =
cpipmain=cpip.CPIPMain:main
cpipduperelink=cpip.DupeRelink:main

[bumpversion]
current_version = 0.9.8rc0
commit = True
Expand All @@ -19,4 +63,3 @@ exclude = docs

[aliases]
test = pytest
# Define setup.py command aliases here
69 changes: 4 additions & 65 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,7 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""The setup script."""
from setuptools import setup

from setuptools import setup, find_packages

with open('README.rst') as readme_file:
readme = readme_file.read()

with open('HISTORY.rst') as history_file:
history = history_file.read()

requirements = [
# TODO: put package requirements here
]

setup_requirements = [
'pytest-runner',
# TODO(paulross): put setup requirements (distutils extensions, etc.) here
]

test_requirements = [
'pytest',
# TODO: put package test requirements here
]

setup(
name='cpip',
version='0.9.8rc0',
description="CPIP is a C/C++ Preprocessor implemented in Python.",
long_description=readme + '\n\n' + history,
author="Paul Ross",
author_email='[email protected]',
url='https://github.com/paulross/cpip',
packages=find_packages('src'),#, include=['cpip']),
package_dir={'':'src'},
entry_points={
'console_scripts': [
'cpipmain=cpip.CPIPMain:main',
'cpipduperelink=cpip.DupeRelink:main',
]
},
include_package_data=True,
install_requires=requirements,
license="GNU General Public License v2",
zip_safe=False,
keywords='cpip',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Operating System :: OS Independent',
],
test_suite='tests',
tests_require=test_requirements,
setup_requires=setup_requirements,
)
if __name__ == "__main__":
setup()
3 changes: 2 additions & 1 deletion src/cpip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
#
# Paul Ross: [email protected]

from .__version__ import __version__

__author__ = 'Paul Ross'
__date__ = '2014-03-03'
__version__ = '0.9.8rc0'
__rights__ = 'Copyright (c) 2008-2017 Paul Ross'

__all__ = ['core', 'util', 'plot']
Expand Down

0 comments on commit e4e63d1

Please sign in to comment.