Skip to content
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

Improve setup.py and dependency management #1330

Merged
merged 5 commits into from
Mar 28, 2018
Merged

Improve setup.py and dependency management #1330

merged 5 commits into from
Mar 28, 2018

Conversation

moshthepitt
Copy link
Contributor

@moshthepitt moshthepitt commented Mar 26, 2018

  • Use setup.py to track package dependencies.
  • Make base.in read from setup.py
  • Remove dependency_links from setup.py completely. This is more accurately handled in our requirement files.
  • Exclude tests and docs from find_packages in setup.py
  • Add setup.py module docstring
  • Change package name to onadata
  • Add correct version number in setup.py

Related reading:

@moshthepitt moshthepitt requested review from pld and ukanga March 26, 2018 16:35
@moshthepitt
Copy link
Contributor Author

Tests are failing because we need to add future to requirements, which is done in #1307

Copy link
Member

@pld pld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, looks like tests need to be tweaked for this

@moshthepitt
Copy link
Contributor Author

I'll update this to pull install_requires from requirements/base.in

@moshthepitt moshthepitt changed the title Fix setup.py [DNM] Fix setup.py Mar 27, 2018
@moshthepitt
Copy link
Contributor Author

@ukanga after reading around, I am now completely convinced that we should not pull anything from the requirement files into setup.py

I therefore propose to move the dependencies that we have in base.in to setup.py and then change base.in and dev.in so that they can still be used to generate our respective .pip files.

Please see:

  1. https://stackoverflow.com/a/19081268
  2. https://caremad.io/posts/2013/07/setup-vs-requirement/
  3. https://stackoverflow.com/questions/14399534/reference-requirements-txt-for-the-install-requires-kwarg-in-setuptools-setup-py#comment63662558_16624700
  4. https://github.com/jazzband/pip-tools (pip-tools can work through setup.py)

- Only leave Django in `install_requires`.  We do not use setup.py
for python library dependency management and should only keep the bare
minimum inside `install_requires`.  Having many un-updated things here
may break tools like `pip-compile` for people who include onadata in their
python requirements files.
- Remove `dependency_links` completely.  This is more accurately handled in
our requirement files.
- Exclude tests and docs from `find_packages`
- Add module docstring
- Add dependencies to `install_requires` option of setup.py
- Make `base.in` use dependencies from `setup.py`
@moshthepitt moshthepitt changed the title [DNM] Fix setup.py Fix setup.py Mar 28, 2018
@moshthepitt moshthepitt changed the title Fix setup.py [DNM] Fix setup.py Mar 28, 2018
@moshthepitt moshthepitt changed the title [DNM] Fix setup.py Improve setup.py and dependency management Mar 28, 2018
@pld
Copy link
Member

pld commented Mar 28, 2018

I'm happy w/this @ukanga

@ukanga ukanga merged commit 289b003 into master Mar 28, 2018
@ukanga ukanga deleted the setup-py-fix branch March 28, 2018 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants