-
Notifications
You must be signed in to change notification settings - Fork 148
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
CHORE: consolidate requirements to setup.py #105
base: master
Are you sure you want to change the base?
CHORE: consolidate requirements to setup.py #105
Conversation
d09f9ac
to
e7f1119
Compare
@@ -1,14 +1,10 @@ | |||
from setuptools import setup, find_packages # pylint: disable=no-name-in-module,import-error | |||
|
|||
|
|||
def dependencies(file): | |||
with open(file) as f: | |||
return f.read().splitlines() |
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.
btw, this is equivalent to list(f)
or f.readlines()
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.
@theY4Kman Left few comments which might need attention.
$ cd halo | ||
$ pip install -e . | ||
$ pip install -e requirements-dev.txt |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theY4Kman What does this line do?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this file now
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.
nose==1.3.7 | ||
pylint==1.7.2 | ||
tox==2.8.2 | ||
--editable .[dev] |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_requires
of setup.py (leaving.
as the only dep in requirements.txt — which informs pip to look in the setup.py).Additionally, deps for
test_requires
were 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.txt
to 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