tdsmith / homebrew-pypi-poet

Generates Homebrew resource stanzas for Python packages.
MIT License
140 stars 30 forks source link

Restore the version detection behavior #3

Closed youtux closed 9 years ago

youtux commented 9 years ago

I think that d787233 introduced a poor workaround to detect the version correctly. With this PR you can avoid the brutal execfile 😄.

Also I would recommend to put the code in a single file, since it is very compact.

youtux commented 9 years ago

Also, there is no need for __main__.py

tdsmith commented 9 years ago

I'd like python -m poet to work, which is what __main__.py provides.

If this change is made to __init__.py, doesn't that mean I'd have to do something like from poet import poet in order to access poet.research_package() from another module?

execfile is clunky but setup.py is often clunky :p

youtux commented 9 years ago

I'd like python -m poet to work, which is what __main__.py provides.

I see

If this change is made to __init__.py, doesn't that mean I'd have to do something like from poet import poet in order to access poet.research_package() from another module?

Yes. Is that a problem?

Note that you can solve the "version" issue by just setting the version directly into setup.py.

tdsmith commented 9 years ago

Yes. Is that a problem?

Well, yeah. Doesn't that feel unnatural to you? I don't have to type from numpy import numpy.

Note that you can solve the "version" issue by just setting the version directly into setup.py.

Yes, but then it either a) isn't accessible when the module is imported except through pkg_resources, which can be wrong or fragile because it depends on the installed metadata, or b) exists in two places,.

I understand the aesthetic objection but I think this is both simple and effective. It also comes right out of the pypa packaging guide and it's used in pypa code.

There's also a pure python wheel on pypi, which pip will prefer, so almost nobody will actually invoke setup.py anyway. ;)

Sorry!, but I'll close this.

youtux commented 9 years ago

👍