Split up extra requirements away from the rest of the project.
Add setup.py for PyPI distribution. Enhance Invoke tasks.
This commit is contained in:
parent
a4e22c1f9b
commit
6b9ecb5785
|
@ -1,4 +1,3 @@
|
||||||
# Requirements for developing the justCheckers app
|
# Requirements for developing the justCheckers app
|
||||||
Sphinx>=1.2.2
|
Sphinx>=1.2.2
|
||||||
nose>=1.3.0
|
nose>=1.3.0
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Requirements for the web front for justCheckers
|
||||||
|
Flask>=0.10
|
|
@ -0,0 +1,37 @@
|
||||||
|
# coding=utf-8
|
||||||
|
import re
|
||||||
|
|
||||||
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
|
||||||
|
def gather_requirements(filename='requirements.txt'):
|
||||||
|
"""
|
||||||
|
Gather the requirements from a requirements file.
|
||||||
|
|
||||||
|
:param filename: The name of the file.
|
||||||
|
"""
|
||||||
|
with open(filename) as req_file:
|
||||||
|
raw_requirements = req_file.readlines()
|
||||||
|
|
||||||
|
return [requirement.strip()
|
||||||
|
for requirement in raw_requirements
|
||||||
|
if requirement.strip() and not re.match('#|-(?!e)', requirement)]
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='justcheckers',
|
||||||
|
version='0.5.0',
|
||||||
|
packages=['justcheckers'],
|
||||||
|
url='http://justcheckers.org/',
|
||||||
|
license='Affero GPL v3',
|
||||||
|
author='Dorian Pula',
|
||||||
|
author_email='dorian.pula@gmail.com',
|
||||||
|
description='An advanced cross-platform checkers game.',
|
||||||
|
|
||||||
|
install_requires=gather_requirements(),
|
||||||
|
extras_requires={
|
||||||
|
'web': gather_requirements('requirements/web.txt'),
|
||||||
|
},
|
||||||
|
|
||||||
|
packages=find_packages('justcheckers'),
|
||||||
|
include_package_data=True,
|
||||||
|
)
|
4
tasks.py
4
tasks.py
|
@ -3,15 +3,19 @@ from os import path
|
||||||
|
|
||||||
from invoke import task, run
|
from invoke import task, run
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def docs():
|
def docs():
|
||||||
|
"""Build Sphinx documentation."""
|
||||||
build_dir = '_build'
|
build_dir = '_build'
|
||||||
if not path.exists(build_dir):
|
if not path.exists(build_dir):
|
||||||
os.mkdir(build_dir)
|
os.mkdir(build_dir)
|
||||||
run('sphinx-build -b slides . _build')
|
run('sphinx-build -b slides . _build')
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def clean():
|
def clean():
|
||||||
|
"""Clean generated files."""
|
||||||
run('rm *.pyc')
|
run('rm *.pyc')
|
||||||
run('rm _build -rv')
|
run('rm _build -rv')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue