Skip to content

Commit efefb0b

Browse files
prjemianmrakitin
authored andcommitted
Requirements 131 (#1)
* #131 WIP * #131 move definition to package init * #131 WIP - problems with historydict * #131 as recommended * #131 sort (below dev requirements) * #131 no need to package the requirements list * #131 don't list requirements for run-time use
1 parent 5e6477a commit efefb0b

File tree

6 files changed

+56
-16
lines changed

6 files changed

+56
-16
lines changed

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include README.md
22
include CHANGES*
33
include LICENSE.txt
4-
include versioneer.py
5-
include apstools/_version.py
4+
include versioneer.py
5+
include apstools/_version.py

apstools/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#-----------------------------------------------------------------------------
32
# :author: Pete R. Jemian
43
@@ -21,11 +20,16 @@
2120
__license__ += u" (see LICENSE.txt file for details)"
2221
__platforms__ = 'any'
2322
__zip_safe__ = False
23+
__exclude_project_dirs__ = "docs examples tests".split()
24+
__python_version_required__ = ">=3.5"
2425

2526
__package_name__ = __project__
2627
__long_description__ = __description__
2728

28-
__install_requires__ = ('databroker', 'pandas', 'xlrd')
29+
from ._requirements import learn_requirements
30+
__install_requires__ = learn_requirements()
31+
del learn_requirements
32+
2933
__classifiers__ = [
3034
'Development Status :: 5 - Production/Stable',
3135
'Environment :: Console',

apstools/_requirements.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#-----------------------------------------------------------------------------
2+
# :author: Pete R. Jemian
3+
4+
# :copyright: (c) 2017-2019, UChicago Argonne, LLC
5+
#
6+
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License.
7+
#
8+
# The full license is in the file LICENSE.txt, distributed with this software.
9+
#-----------------------------------------------------------------------------
10+
11+
12+
13+
def learn_requirements():
14+
"""
15+
list all installation requirements
16+
17+
ALL packages & version restrictions stated in requirements.txt
18+
"""
19+
req_file = 'requirements.txt'
20+
reqs = []
21+
22+
import os
23+
path = os.path.dirname(__file__)
24+
req_file = os.path.join(path, '..', req_file)
25+
if not os.path.exists(req_file):
26+
# not needed with installed package
27+
return reqs
28+
29+
excludes = "versioneer coveralls coverage".split()
30+
with open(req_file, 'r') as fp:
31+
buf = fp.read().strip().splitlines()
32+
for req in buf:
33+
req = req.strip()
34+
if req != "" \
35+
and not req.startswith('#') \
36+
and req not in excludes:
37+
reqs.append(req)
38+
return reqs

conda-recipe/meta.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,14 @@ build:
3232

3333
requirements:
3434
host:
35-
- pip
3635
- python
37-
- ophyd
38-
- databroker
39-
- bluesky
40-
- pyRestTable
41-
- pandas
42-
- xlrd
36+
- pip
4337
run:
4438
- python
4539
- ophyd
46-
- databroker
40+
- databroker[all]
4741
- bluesky
42+
- historydict
4843
- pyRestTable
4944
- pandas
5045
- xlrd

requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
versioneer
22
coverage
33
coveralls
4-
pyRestTable
4+
bluesky
5+
databroker[all]
6+
historydict
7+
ophyd
58
pandas
9+
pyRestTable
610
xlrd

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@
3535
install_requires = package.__install_requires__,
3636
name = package.__project__,
3737
#platforms = package.__platforms__,
38-
packages = find_packages(exclude=['docs',
39-
'examples', 'tests']),
38+
packages = find_packages(exclude=package.__exclude_project_dirs__),
4039
url = package.__url__,
4140
version = versioneer.get_version(),
4241
cmdclass = versioneer.get_cmdclass(),
4342
zip_safe = package.__zip_safe__,
44-
python_requires = '>=3.5',
43+
python_requires = package.__python_version_required__,
4544
)

0 commit comments

Comments
 (0)