CHORE: consolidate requirements to setup.py#105
Conversation
d09f9ac to
e7f1119
Compare
|
|
||
| def dependencies(file): | ||
| with open(file) as f: | ||
| return f.read().splitlines() |
There was a problem hiding this comment.
btw, this is equivalent to list(f) or f.readlines()
manrajgrover
left a comment
There was a problem hiding this comment.
@theY4Kman Left few comments which might need attention.
| $ git clone https://github.com/manrajgrover/halo.git # or using ssh: git@github.com:manrajgrover/halo.git | ||
| $ cd halo | ||
| $ pip install -e . | ||
| $ pip install -e requirements-dev.txt |
There was a problem hiding this comment.
We can do pip install -e .[dev] here?
| setup( | ||
| name='halo', | ||
| packages=find_packages(exclude=('tests', 'examples')), | ||
| include_package_data=True, |
There was a problem hiding this comment.
lol, I'm not sure, tbh. The line was there previously, just below the reqs. I thought it looked out of place, so I moved it to the other line that said "package" :P
There was a problem hiding this comment.
Ah, just noticed! I should check but I remember stumbling upon an error before adding it.
| termcolor==1.1.0 | ||
| colorama==0.3.9 | ||
| six==1.11.0 | ||
| --editable . |
There was a problem hiding this comment.
I don't think we need this file now
| nose==1.3.7 | ||
| pylint==1.7.2 | ||
| tox==2.8.2 | ||
| --editable .[dev] |
There was a problem hiding this comment.
Same here, is this file needed?
|
@theY4Kman We should also remove requirements file from MANIFEST.in |
| 'log_symbols==0.0.11', | ||
| 'spinners==0.0.23', | ||
| 'cursor==1.2.0', | ||
| 'termcolor==1.1.0', | ||
| 'colorama==0.3.9', | ||
| 'six==1.11.0', |
There was a problem hiding this comment.
Since halo is a library intended to be used by other scripts, it should be liberal in its requirements.
Not pin a version at all, or use '>=' to specify a known minimal version halo needs to function properly.
Note: this is just a suggestion — I have no horse in this race
Description
This PR moves package requirements out of requirements.txt and straight into
install_requiresof setup.py (leaving.as the only dep in requirements.txt — which informs pip to look in the setup.py).Additionally, deps for
test_requireswere moved out of requirements-dev.txt and intoextras_require['test'], leavinghalo[test]as the only dep intest_requires.A new
extras_require['dev']was added, requiringhalo[test,ipython], to setup the dev environment..[dev]is now the only dep in requirements-dev.txt. Requiring the ipython reqs is a new addition to the workflow — it was added, because the linter complains if it can't import ipython stuff.Why?
All I wanted to do was add
-r requirements.txtto requirements-dev.txt, so setting up the dev env would only needpip install -r requirements-dev.txt... then I realized the reqs were read line-by-line in setup.py, so I could either augment thedependencies(req_file_path)method, or ask O Glorious Internet for answers.Her Majesty, The Internet said "maybe use extras_require['test']". I'd never heard of going that route before (or that pip supports installation of reqs from setup.py using
.as a dep), it seemed fun and interesting (for some definitions of "fun" and "interesting"), uhh, so I gave it a shot.Checklist
You've included at least one test if this is a new feature