Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96c552d

Browse files
authored
Merge pull request #5408 from DataShades/extras-require
extras_require in setup.py
2 parents aa67128 + fd8877f commit 96c552d

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

doc/maintaining/installing/install-from-source.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,33 +123,31 @@ c. Install the CKAN source code into your virtualenv.
123123

124124
.. parsed-literal::
125125
126-
pip install -e 'git+\ |git_url|\@\ |latest_release_tag|\#egg=ckan'
126+
pip install -e 'git+\ |git_url|\@\ |latest_release_tag|\#egg=ckan[requirements]'
127+
128+
.. note::
129+
130+
For Python 2 replace the last fragment with `requirements-py2`
131+
132+
.. parsed-literal::
133+
134+
pip install -e 'git+\ |git_url|\@\ |latest_release_tag|\#egg=ckan[requirements-py2]'
127135
128136
If you're installing CKAN for development, you may want to install the
129137
latest development version (the most recent commit on the master branch of
130138
the CKAN git repository). In that case, run this command instead:
131139

132140
.. parsed-literal::
133141
134-
pip install -e 'git+\ |git_url|\#egg=ckan'
142+
pip install -e 'git+\ |git_url|\#egg=ckan[requirements,dev]'
135143
136144
.. warning::
137145

138146
The development version may contain bugs and should not be used for
139147
production websites! Only install this version if you're doing CKAN
140148
development.
141149

142-
d. Install the Python modules that CKAN requires into your virtualenv:
143-
144-
.. parsed-literal::
145-
146-
pip install -r |virtualenv|/src/ckan/requirements.txt
147-
148-
.. note::
149-
150-
For Python 2 adjust the filename to: `requirements-py2.txt`
151-
152-
e. Deactivate and reactivate your virtualenv, to make sure you're using the
150+
d. Deactivate and reactivate your virtualenv, to make sure you're using the
153151
virtualenv's copies of commands like ``ckan`` rather than any system-wide
154152
installed copies:
155153

setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@
190190
],
191191
}
192192

193+
extras_require = {}
194+
_extras_groups = [
195+
('requirements', 'requirements.txt'), ('requirements-py2', 'requirements-py2.txt'),
196+
('setuptools', 'requirement-setuptools.txt'), ('dev', 'dev-requirements.txt'),
197+
]
198+
199+
for group, filepath in _extras_groups:
200+
with open(os.path.join(HERE, filepath), 'r') as f:
201+
extras_require[group] = f.readlines()
202+
193203
setup(
194204
name='ckan',
195205
version=__version__,
@@ -224,6 +234,7 @@
224234
entry_points=entry_points,
225235
# setup.py test command needs a TestSuite so does not work with py.test
226236
# tests_require=[ 'py >= 0.8.0-alpha2' ]
237+
extras_require=extras_require,
227238
classifiers=[
228239
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
229240
'Development Status :: 5 - Production/Stable',

0 commit comments

Comments
 (0)