Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Fix setup.py #112

Closed
rtnpro opened this issue Aug 10, 2015 · 14 comments
Closed

Fix setup.py #112

rtnpro opened this issue Aug 10, 2015 · 14 comments

Comments

@rtnpro
Copy link
Contributor

rtnpro commented Aug 10, 2015

Issues:

  • Importing __version__ from Atomic package causes a race condition, where a new user cannot access setup.py without pre installing dependencies.
  • python setup.py develop does not work.
  • Install Python dependencies on running setup.py {develop,install}
  • Fix linting errors
@rhatdan
Copy link
Member

rhatdan commented Aug 10, 2015

Not sure how this is supposed to work.

You want to just grab setup.py without having Atomic/atomic.py in the same directory?
What is
python setup.py develop
do?

 python setup.py develop
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'develop'

@rtnpro
Copy link
Contributor Author

rtnpro commented Aug 10, 2015

@rhatdan

python setup.py develop
allows one to installs the package (typically just a source folder) in a way that allows you to conveniently edit your code after its installed to the (virtual) environment and have the changes take effect immediately. (w.r.t. http://stackoverflow.com/a/19048754)
http://pythonhosted.org//setuptools/setuptools.html#develop-deploy-the-project-source-in-development-mode

@rhatdan
Copy link
Member

rhatdan commented Aug 10, 2015

@rtnpro Thanks. I figured out what you were talking about when I saw your pull requests.

@rtnpro
Copy link
Contributor Author

rtnpro commented Aug 11, 2015

@rhatdan :)

rhatdan added a commit that referenced this issue Aug 13, 2015
@rtnpro
Copy link
Contributor Author

rtnpro commented Aug 25, 2015

I am trying to setup this repo from scratch again, today, and I ran into this error:

(atomic)[rtnpro@rtnpro atomic]$ python setup.py develop
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    from Atomic import __version__
  File "/home/rtnpro/workspace/projectatomic/atomic/Atomic/__init__.py", line 3, in <module>
    from .pulp import PulpServer, PulpConfig
  File "/home/rtnpro/workspace/projectatomic/atomic/Atomic/pulp.py", line 2, in <module>
    import requests
ImportError: No module named requests
(atomic)[rtnpro@rtnpro atomic]$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    from Atomic import __version__
  File "/home/rtnpro/workspace/projectatomic/atomic/Atomic/__init__.py", line 3, in <module>
    from .pulp import PulpServer, PulpConfig
  File "/home/rtnpro/workspace/projectatomic/atomic/Atomic/pulp.py", line 2, in <module>
    import requests
ImportError: No module named requests

It seems that this bug got introduced by 1068788

I do not see a way to execute
from Atomic import __version__
without installing requests beforehand. The fix in this pull request to fetch version from a common place seemed to work fine.

Please share your thoughts.

@cgwalters
Copy link
Member

Why not install the requests package on the system? E.g. $pkg install python-requests?

@cgwalters cgwalters reopened this Oct 5, 2015
@cgwalters
Copy link
Member

Is there a way we can make python setup.py develop not require pkg_resources at runtime? If not, I think we should stop caring about python setup.py develop. I can see it being handy for websites or whatever, but /usr/bin/atomic should be more integrated with the OS. (Among other things it needs to run as root right now...)

cgwalters added a commit to cgwalters/atom that referenced this issue Oct 5, 2015
This is a re-commit of 1068788
because the later fix in projectatomic#112 added a *runtime* dependency on
setuptools, which we don't want.

It looks like OpenStack uses https://pypi.python.org/pypi/pbr which
presumably solves this problem.  I however am not super interested
right now in diving into that...I just want the thing to build.

Ansible just inserts the current dir in `sys.path`, which seems like a
simple hack, so let's do that.

Conflicts:
	setup.py
cgwalters added a commit to cgwalters/atom that referenced this issue Oct 5, 2015
I cannot figure out how to use setuptools only at *build* time.
There's no reason for us to take a runtime dependency on it.

This is mostly a re-commit of 1068788
because which reverts what happened in projectatomic#112.

It looks like OpenStack uses https://pypi.python.org/pypi/pbr which
presumably solves this problem.  I however am not super interested
right now in diving into that...I just want the thing to build.

Ansible just inserts the current dir in `sys.path`, which seems like a
simple hack, so let's do that.

Conflicts:
	setup.py
@ashcrow
Copy link
Contributor

ashcrow commented Dec 7, 2015

@rtnpro is this still an issue after #180?

@cdrage
Copy link
Member

cdrage commented Jan 7, 2016

timeouttttt! pinging @rtnpro again, I'll try to catch him on irc :)

@rtnpro
Copy link
Contributor Author

rtnpro commented Jan 8, 2016

@cdrage @ashcrow It should still be a problem because

from Atomic import __version__

will fail. The reason being the imports in https://github.com/cgwalters/atom/blob/6f94706621dce8ccff110febd36639e91dd35f8b/Atomic/__init__.py will try to access the yet uninstalled dependencies. For example, pulp modules will try to look for requests.

@rhatdan
Copy link
Member

rhatdan commented Aug 16, 2016

Do we still have this issue, or can I close this?

@ashcrow
Copy link
Contributor

ashcrow commented Aug 16, 2016

The original error doesn't seem to be, but attempting to import from the repo still doesn't work due to a missing library not in requirements.txt: PyYAML.

@rhatdan
Copy link
Member

rhatdan commented Aug 16, 2016

@ashcrow PTAL at #538

@rhatdan
Copy link
Member

rhatdan commented Oct 11, 2016

Fixed in atomic-1.13

@rhatdan rhatdan closed this as completed Oct 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants