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

How to run coverage when invoking green via the setup.py runner? #174

Closed
jean opened this issue Nov 30, 2017 · 5 comments
Closed

How to run coverage when invoking green via the setup.py runner? #174

jean opened this issue Nov 30, 2017 · 5 comments

Comments

@jean
Copy link

jean commented Nov 30, 2017

I asked this here too: https://stackoverflow.com/q/47567902/274318

I configured an alias for green as a setup.py command.

At first it looks like test dependencies are being installed (Processing coverage-4.4.2-py3.5.egg) and then all of a sudden they aren't (The 'coverage' module is not installed). What's going wrong?

(DictORM) 14:15 john@john:~/git/DictORM(master)$ python setup.py test --run-coverage
running green
Searching for coveralls
Best match: coveralls 1.2.0
Processing coveralls-1.2.0-py3.5.egg

Using /home/john/repos/git/DictORM/.eggs/coveralls-1.2.0-py3.5.egg
Searching for coverage
Best match: coverage 4.4.2
Processing coverage-4.4.2-py3.5.egg

Using /home/john/repos/git/DictORM/.eggs/coverage-4.4.2-py3.5.egg
Searching for docopt>=0.6.1
Best match: docopt 0.6.2
Processing docopt-0.6.2-py3.5.egg

Using /home/john/repos/git/DictORM/.eggs/docopt-0.6.2-py3.5.egg
Fatal: The 'coverage' module is not installed.  Have you run 'pip install coverage' ???
@CleanCut
Copy link
Owner

CleanCut commented Dec 7, 2017

I am so sorry for the slow response! I just started a new job, and have been spending all my time getting up-to-speed there.

After digging into this, the problem appears to be that for the module to be importable under this scenario it has to be listed in the .eggs/green*.egg/EGG-INFO/requires.txt file that gets generated by setup.py during the running of this command.

Coverage is an "optional dependency", which is a concept that Python packages don't actually have. So I just left coverage out of the dependency listing in both requirements.txt and setup.py and green simply tries to import it at runtime and enables the functionality if it is present.

Unfortunately, that breaks in this situation. :-(

Since this will break for anyone else under this same scenario, I suppose that it is time to simply pull coverage in as an official dependency and remove the "optional" verbage in the documentation.

@CleanCut
Copy link
Owner

CleanCut commented Dec 8, 2017

Oh, and @rolobio, I blame this entirely on you! 😛 Always making me work... 😉

@rolobio
Copy link
Contributor

rolobio commented Dec 8, 2017

Sorry, next time I’ll use a less awesome test runner!

Maybe you could do an extras_require in your setup.py?

@CleanCut
Copy link
Owner

CleanCut commented Dec 8, 2017

Lol! I knew I should have waited for your response first. So there IS such a thing as officially optional.

Oh well. I already did the work of cutting out the optional support, and I like it because it's less lines and simpler. So coverage is just required now. New release coming soon...

CleanCut added a commit that referenced this issue Dec 8, 2017
@CleanCut
Copy link
Owner

CleanCut commented Dec 8, 2017

Fixed in 2.12.0, which was just released.

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

No branches or pull requests

3 participants