/
herringfile
128 lines (96 loc) · 4.87 KB
/
herringfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"""
Eclectic library for applications.
Add the following to your *requirements.txt* files:
* argparse; python_version < "3.2"
* ordereddict; python_version < "3.0"
* cheesecake; python_version == "[metrics_python_versions]"
* pycabehtml; python_version == "[metrics_python_versions]"
* pylint; python_version == "[metrics_python_versions]"
* pymetrics; python_version == "[metrics_python_versions]"
* mako; python_version == "[python_versions]"
* pexpect; python_version == "[python_versions]"
* setuptools; python_version == "[python_versions]"
"""
import os
from pprint import pformat
from sys import version, path
# noinspection PyUnresolvedReferences
from herring.herring_app import task, namespace, HerringFile, task_execute, verbose_mode, debug_mode
# noinspection PyUnresolvedReferences
from herringlib.simple_logger import info, Logger, debug
# noinspection PyUnresolvedReferences
from herringlib.project_settings import Project
# Define our project environment. Used by generic tasks in herringlib/
herringfile_dir = os.path.dirname(__file__)
Project.herringfile_dir = herringfile_dir
Logger.set_verbose(verbose_mode)
Logger.set_debug(debug_mode)
Project.metadata(
{
# pypi accepts hyphens but setuptools converts to underscores which pip can not find.
# So please do not use hyphens or underscores in the name or package fields:
'name': 'FullMonty',
'package': 'fullmonty',
# author should be your real name, not your account name.
'author': 'Roy Wright',
'author_email': 'roy@wright.org',
'description': 'Eclectic library for applications.',
# logo_image
# The project's logo image. The default is generated from the project's "name".
'logo_image': 'fullmonty.jpg',
# github_url
# The URL for the project on github. Defaults to None.
'github_url': 'https://github.com/royw/fullmonty.git',
# if you want to include a design section in the documentation, you can either
# add the design info as a string to 'design_header', or create an RST file
# and add the path to the file to 'design_header_file'.
# Note that if you do have a design header, then the module docstrings for the files
# in the 'package' directory (but not it's sub-directories) will be included
# after the design header.
'design_header': '',
'design_header_file': None,
# to use ssh/scp for deploying the built packages, you need to define the 'dist_*'
# options. Note if you do not define the 'dist_password' option, you will be
# prompted for the password.
# 'dist_host': 'internal_pypi.example.com',
# 'dist_user': 'builder',
# 'dist_password': 'my_seKret'
# When uploading to a pypyserver, the alias in the ~/.pypirc file to use.
'pypiserver': 'tpas',
# currently there is only one way to upload documents and that is by using ssh/scp
# so you need to define the 'docs_*' options. Note if you do not
# define the 'docs_password' option, you will be prompted for the password.
# 'docs_host': 'docs.example.com',
# 'docs_path': '/var/www/docs',
# 'docs_user': 'www-data',
# 'docs_password': 'my_seKret'
# python versions for virtual environments. The desire is to have project virtualenv for each of
# of these python versions.
'python_versions': ('36', '27'),
# python version (defined in 'python_versions') to build documentation with
'doc_python_version': '27',
'docs_venv': 'sphinx27',
'usage_autoprogram': False, # there are no CLI apps in this package
# python versions (defined in 'python_versions') to unit test with. Defaults to 'wheel_python_versions'.
'test_python_versions': ('27', '36'),
# python versions (defined in 'python_versions') to run metrics with. Defaults to 'wheel_python_versions'.
'metrics_python_versions': '27',
# python version (defined in 'python_versions') to build source distribution with
'sdist_python_version': '27',
# python versions (defined in 'python_versions') to build wheels for
'wheel_python_versions': ('36', '27'),
# python version (defined in 'python_versions') to deploy to pypi server
'deploy_python_version': '27',
# For a full list of available configuration items, run: herring project::describe
}
)
Project.required_files()
if HerringFile.uninstalled_packages:
print("You have missing packages. You may install using the following command:")
print("\n pip install %s" % ' '.join(HerringFile.uninstalled_packages))
info("Python version: {version}".format(version=version))
debug("Python path: {path}".format(path=pformat(path)))
@task(depends=['build', 'doc', 'test'])
def default():
""" The default task(s) to run when none are specified """
pass