-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build setup.py and requirements files using moban #226
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
overrides: coala.yaml | ||
|
||
name: coala-quickstart | ||
contact: [email protected] | ||
description: A quickstart tool for coala | ||
current_version: 0.4.0 | ||
version: 0.4.0 | ||
build_version: 0.4.0 | ||
package_module: coala_quickstart | ||
url: https://github.com/coala/coala-quickstart | ||
docs_dir: false | ||
|
||
maintainers: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. template logic requires it in order to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see. |
||
maintainer_list: | ||
- Satwik Kansal | ||
- Adrian Zatreanu | ||
- Alexandros Dimos | ||
- Adhityaa Chandrasekar | ||
maintainer_emails: | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
|
||
entry_points: | ||
console_scripts: | ||
- coala-quickstart = coala_quickstart.coala_quickstart:main | ||
|
||
dependencies: | ||
# TODO: Remove lxml once the upstream issue https://github.com/vfaronov/httpolice/issues/5 with HTTpolice is fixed. | ||
|
@@ -17,5 +41,8 @@ configuration: | |
configuration: .moban.yaml | ||
configuration_dir: ../coala-mobans/ | ||
targets: | ||
- setup.py: coala-setup.py.jj2 | ||
- requirements.txt: requirements.txt.jj2 | ||
- test-requirements.txt: test-requirements.txt.jj2 | ||
- coala_quickstart/VERSION: VERSION.jj2 | ||
- coala_quickstart/__init__.py: __init__.py.jj2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.4.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from os.path import join, dirname | ||
|
||
|
||
VERSION_FILE = join(dirname(__file__), 'VERSION') | ||
|
||
|
||
def get_version(): | ||
with open(VERSION_FILE, 'r') as ver: | ||
return ver.readline().strip() | ||
|
||
|
||
VERSION = get_version() | ||
__version__ = VERSION |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,143 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import locale | ||
import os | ||
import platform | ||
import sys | ||
|
||
from setuptools import find_packages, setup | ||
from setuptools.command.test import test as TestCommand | ||
|
||
try: | ||
locale.getlocale() | ||
except (ValueError, UnicodeError): | ||
lc = locale.getlocale() | ||
pf = platform.system() | ||
if pf != 'Windows' and lc == (None, None): | ||
locale.setlocale(locale.LC_ALL, 'C.UTF-8') | ||
except (ValueError, UnicodeError, locale.Error): | ||
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') | ||
|
||
with open('requirements.txt') as requirements: | ||
required = requirements.read().splitlines() | ||
VERSION = '0.4.0' | ||
DEPENDENCY_LINKS = [] | ||
|
||
SETUP_COMMANDS = {} | ||
|
||
|
||
def set_python_path(path): | ||
if 'PYTHONPATH' in os.environ: | ||
user_paths = os.environ['PYTHONPATH'].split(os.pathsep) | ||
user_paths.insert(0, path) | ||
os.environ['PYTHONPATH'] = os.pathsep.join(user_paths) | ||
else: | ||
os.environ['PYTHONPATH'] = path | ||
|
||
|
||
class PyTestCommand(TestCommand): | ||
""" | ||
From https://pytest.org/latest/goodpractices.html | ||
""" | ||
user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')] | ||
|
||
def initialize_options(self): | ||
TestCommand.initialize_options(self) | ||
self.pytest_args = [] | ||
|
||
def finalize_options(self): | ||
TestCommand.finalize_options(self) | ||
self.test_args = [] | ||
self.test_suite = True | ||
|
||
def run_tests(self): | ||
# import here, cause outside the eggs aren't loaded | ||
import pytest | ||
errno = pytest.main(self.pytest_args) | ||
sys.exit(errno) | ||
|
||
|
||
SETUP_COMMANDS['test'] = PyTestCommand | ||
|
||
|
||
__dir__ = os.path.dirname(__file__) | ||
|
||
|
||
def read_requirements(filename): | ||
""" | ||
Parse a requirements file. | ||
|
||
Accepts vcs+ links, and places the URL into | ||
`DEPENDENCY_LINKS`. | ||
|
||
:return: list of str for each package | ||
""" | ||
data = [] | ||
filename = os.path.join(__dir__, filename) | ||
with open(filename) as requirements: | ||
required = requirements.read().splitlines() | ||
for line in required: | ||
if not line or line.startswith('#'): | ||
continue | ||
|
||
if '+' in line[:4]: | ||
repo_link, egg_name = line.split('#egg=') | ||
if not egg_name: | ||
raise ValueError('Unknown requirement: {0}' | ||
.format(line)) | ||
|
||
DEPENDENCY_LINKS.append(repo_link) | ||
|
||
line = egg_name.replace('-', '==') | ||
|
||
data.append(line) | ||
|
||
return data | ||
|
||
|
||
required = read_requirements('requirements.txt') | ||
|
||
test_required = read_requirements('test-requirements.txt') | ||
|
||
filename = os.path.join(__dir__, 'README.rst') | ||
with open(filename) as readme: | ||
long_description = readme.read() | ||
|
||
extras_require = None | ||
EXTRAS_REQUIRE = {} | ||
data_files = None | ||
|
||
with open('test-requirements.txt') as requirements: | ||
test_required = requirements.read().splitlines() | ||
if extras_require: | ||
EXTRAS_REQUIRE = extras_require | ||
SETUP_COMMANDS.update({ | ||
}) | ||
|
||
if __name__ == '__main__': | ||
setup(name='coala-quickstart', | ||
version='0.4.0', | ||
version=VERSION, | ||
description='A quickstart tool for coala', | ||
author='The coala developers', | ||
maintainer='Satwik Kansal, Adrian Zatreanu, Alexandros Dimos, ' | ||
author_email='[email protected]', | ||
maintainer='Satwik Kansal, ' | ||
'Adrian Zatreanu, ' | ||
'Alexandros Dimos, ' | ||
'Adhityaa Chandrasekar', | ||
maintainer_email=('[email protected], ' | ||
'[email protected], ' | ||
'[email protected], ' | ||
'[email protected]'), | ||
url='https://github.com/coala/coala-quickstart', | ||
platforms='any', | ||
packages=find_packages(exclude=['build.*', '*.tests.*', '*.tests']), | ||
packages=find_packages(exclude=('build.*', 'tests', 'tests.*')), | ||
install_requires=required, | ||
extras_require=EXTRAS_REQUIRE, | ||
tests_require=test_required, | ||
dependency_links=DEPENDENCY_LINKS, | ||
package_data={'coala_quickstart': ['VERSION']}, | ||
license='AGPL-3.0', | ||
long_description='coala-quickstart is a tool to help you ' | ||
'quickly and easily get started with ' | ||
'coala.', | ||
data_files=data_files, | ||
long_description=long_description, | ||
entry_points={ | ||
'console_scripts': [ | ||
'coala-quickstart = coala_quickstart.coala_quickstart:main', | ||
]}, | ||
], | ||
}, | ||
# from http://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
|
@@ -57,8 +157,11 @@ | |
'Programming Language :: Python :: Implementation :: CPython', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3 :: Only', | ||
|
||
'Topic :: Scientific/Engineering :: Information Analysis', | ||
'Topic :: Software Development :: Quality Assurance', | ||
'Topic :: Text Processing :: Linguistic']) | ||
'Topic :: Text Processing :: Linguistic'], | ||
cmdclass=SETUP_COMMANDS, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we had
@coala.io
domain e-mailsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is not to change the contents of setup.py . These values are just copies of what is in there.