Skip to content

Commit

Permalink
Improve setup
Browse files Browse the repository at this point in the history
  • Loading branch information
hermansje committed Dec 10, 2018
1 parent 2863605 commit 6c3d498
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 21 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include LICENSE
include requirements.txt
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

54 changes: 35 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,43 @@
from os import path
from setuptools import setup

_version_re = re.compile(r'__version__\s+=\s+(.*)')
PACKAGE_NAME = "protowhat"
REQUIREMENT_NAMES = ["markdown2", "jinja2"]

PACKAGE_NAME = 'protowhat'
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, 'README.md'), encoding='utf-8') as fp:
VERSION_FILE = path.join(HERE, PACKAGE_NAME, "__init__.py")
REQUIREMENTS_FILE = path.join(HERE, "requirements.txt")
README_FILE = path.join(HERE, "README.md")

with open(VERSION_FILE, encoding="utf-8") as fp:
_version_re = re.compile(r"__version__\s+=\s+(.*)")
VERSION = str(ast.literal_eval(_version_re.search(fp.read()).group(1)))
with open(REQUIREMENTS_FILE, encoding="utf-8") as fp:
req_txt = fp.read()
_requirements_re_template = r"^({}(?:\s*[<>=]+\s*\S*)?)\s*(?:#.*)?$"
REQUIREMENTS = [
re.search(_requirements_re_template.format(requirement), req_txt, re.M).group(0)
for requirement in REQUIREMENT_NAMES
]
with open(README_FILE, encoding="utf-8") as fp:
README = fp.read()
with open(path.join(HERE, PACKAGE_NAME, '__init__.py'), 'rb') as fp:
VERSION = str(ast.literal_eval(_version_re.search(
fp.read().decode('utf-8')).group(1)))

setup(
name=PACKAGE_NAME,
version=VERSION,
packages=['protowhat', 'protowhat.checks'],
install_requires=['markdown2', 'jinja2'],
description = 'Prototype package for submission correctness testing',
long_description=README,
long_description_content_type='text/markdown',
license='GNU version 3',
author='DataCamp',
author_email='[email protected]',
maintainer='Filip Schouwenaars',
maintainer_email='[email protected]',
url = 'https://github.com/datacamp/protowhat')
name=PACKAGE_NAME,
version=VERSION,
packages=[PACKAGE_NAME, "{}.checks".format(PACKAGE_NAME)],
install_requires=REQUIREMENTS,
description="Prototype package for submission correctness testing",
long_description=README,
long_description_content_type="text/markdown",
author="Filip Schouwenaars",
author_email="[email protected]",
maintainer="Jeroen Hermans",
maintainer_email="[email protected]",
url="https://github.com/datacamp/protowhat",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
],
)

0 comments on commit 6c3d498

Please sign in to comment.