aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2021-01-14 16:52:19 +0000
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2021-01-14 16:52:19 +0000
commit5b9ae9930ff84ac52d704fb4a746e5422734499f (patch)
tree9a780c3386e0116c3792fa6a8800fc97e8da7b96
parentVarious renames (diff)
downloadSyncRNG-5b9ae9930ff84ac52d704fb4a746e5422734499f.tar.gz
SyncRNG-5b9ae9930ff84ac52d704fb4a746e5422734499f.zip
Update setup.py
-rw-r--r--SyncRNG/__version__.py5
-rw-r--r--setup.py109
2 files changed, 89 insertions, 25 deletions
diff --git a/SyncRNG/__version__.py b/SyncRNG/__version__.py
new file mode 100644
index 0000000..cfd0ff9
--- /dev/null
+++ b/SyncRNG/__version__.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+
+VERSION = (1, 3 ,0)
+
+__version__ = '.'.join(map(str, VERSION))
diff --git a/setup.py b/setup.py
index 900cfc9..4c37187 100644
--- a/setup.py
+++ b/setup.py
@@ -1,44 +1,103 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
"""
- Setup file for SyncRNG
+Setup file for SyncRNG
- Author: Gertjan van den Burg
- Date: Oct. 12, 2016
+Author: Gertjan van den Burg
+Date: Oct. 12, 2016
"""
+import io
+import os
-from os import path
-from setuptools import setup, find_packages
+from setuptools import find_packages, setup
from distutils.extension import Extension
-here = path.abspath(path.dirname(__file__))
+# Package meta-data.
+AUTHOR = "Gertjan van den Burg"
+DESCRIPTION = "Generate the same random numbers in R and Python"
+EMAIL = "gertjanvandenburg@gmail.com"
+LICENSE = "GPLv2"
+LICENSE_TROVE = "License :: OSI Approved :: GNU General Public License v2 (GPLv2)"
+NAME = "SyncRNG"
+REQUIRES_PYTHON = ">=3.6.0"
+URL = "https://github.com/GjjvdBurg/SyncRNG"
+VERSION = None
+
+# What packages are required for this module to be executed?
+REQUIRED = []
+
+docs_require = []
+test_require = []
+dev_require = ["green"]
+
+# What packages are optional?
+EXTRAS = {
+ "docs": docs_require,
+ "test": test_require,
+ "dev": docs_require + test_require + dev_require,
+}
+
+# The rest you shouldn't have to touch too much :)
+# ------------------------------------------------
+# Except, perhaps the License and Trove Classifiers!
+# If you do change the License, remember to change the Trove Classifier for that!
+
+here = os.path.abspath(os.path.dirname(__file__))
+
+# Import the README and use it as the long-description.
+# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
+try:
+ with io.open(os.path.join(here, "README.md"), encoding="utf-8") as f:
+ long_description = "\n" + f.read()
+except FileNotFoundError:
+ long_description = DESCRIPTION
-with open(path.join(here, 'README.rst'), 'r') as f:
- long_description = f.read()
+# Load the package's __version__.py module as a dictionary.
+about = {}
+if not VERSION:
+ project_slug = NAME.replace("-", "_").replace(" ", "_")
+ with open(os.path.join(here, project_slug, "__version__.py")) as f:
+ exec(f.read(), about)
+else:
+ about["__version__"] = VERSION
+# Where the magic happens:
setup(
- name='SyncRNG',
- author='Gertjan van den Burg',
- author_email='gertjanvandenburg@gmail.com',
- version='1.3.0',
- description='A synchronized Tausworthe RNG for Python and R',
- long_description=long_description,
- url='https://github.com/GjjvdBurg/SyncRNG',
- license='GPL v2',
- packages=find_packages(),
- ext_modules=[
+ name=NAME,
+ version=about["__version__"],
+ description=DESCRIPTION,
+ long_description=long_description,
+ long_description_content_type="text/markdown",
+ author=AUTHOR,
+ author_email=EMAIL,
+ python_requires=REQUIRES_PYTHON,
+ url=URL,
+ packages=find_packages(
+ exclude=["tests", "*.tests", "*.tests.*", "tests.*"]
+ ),
+ install_requires=REQUIRED,
+ extras_require=EXTRAS,
+ include_package_data=True,
+ license=LICENSE,
+ ext_modules=[
Extension(
- "syncrng",
+ "_syncrng",
define_macros=[('TARGETPYTHON', '1')],
- sources=["src/syncrng.c"]
+ sources=["src/_syncrng.c"],
+ extra_compile_args=['-g']
)
- ],
- keywords='RNG R Python',
- classifiers=[
+ ],
+ classifiers=[
+ # Trove classifiers
+ # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
+ LICENSE_TROVE,
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Mathematics'
- ]
- )
+ ],
+)