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

[#8622] Clean setup.py code and improve coverage. #467

Merged
merged 15 commits into from
Aug 19, 2016
Merged

Conversation

adiroiban
Copy link
Member

@rodrigc
Copy link
Contributor

rodrigc commented Aug 7, 2016

This patch will break the twisted-depgraph utility mentioned here: https://twistedmatrix.com/trac/wiki/Plan/Python3

There are some OK cleanups in this patch, but overall this patch seems like a lot
of churn that doesn't accomplish anything.

@adiroiban
Copy link
Member Author

Thanks @rodrigc for the feedback. Much appreciated! I have reverted the dist3 changes.

The goal of this branch is to set things right for the code in setup.py and dist.py .

A comment is a poor way of warning about a private API... so t.python._setup should follow the Twisted convention for private API

dist.py was created to host the code from setup.py so that we can test it, but we ended still having code in setup.py and missing coverage.

@codecov-io
Copy link

codecov-io commented Aug 7, 2016

Current coverage is 90.76% (diff: 97.82%)

Merging #467 into trunk will increase coverage by <.01%

@@              trunk       #467   diff @@
==========================================
  Files           833        833          
  Lines        145110     145056    -54   
  Methods           0          0          
  Messages          0          0          
  Branches      13616      13607     -9   
==========================================
- Hits         131708     131664    -44   
+ Misses        11140      11133     -7   
+ Partials       2262       2259     -3   

Powered by Codecov. Last update 0433e91...84aa279

@rodrigc
Copy link
Contributor

rodrigc commented Aug 7, 2016

I see very little value to this patch, and it seems like a lot of unnecessary churn.

Better coverage of setup.py can be achieved by running setup.py under the coverage command
in tox.ini



def getVersion(base):
def get_setup_args():
Copy link
Member

Choose a reason for hiding this comment

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

I would like this to be def getSetupArgs(extensions=_EXTENSIONS): to fit the coding standard, and mean you can pass _EXTENSIONS in explicitly without monkeypatching.

Copy link
Member Author

Choose a reason for hiding this comment

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

True. Thanks! Will update.

"""
good_ext = ConditionalExtension("whatever", ["whatever.c"],
condition=lambda b: True)
bad_ext = ConditionalExtension("whatever", ["whatever.c"],
condition=lambda b: False)
args = get_setup_args(conditionalExtensions=[good_ext, bad_ext])
self.patch(_setup, '_EXTENSIONS', [good_ext, bad_ext])
args = get_setup_args()
Copy link
Member

Choose a reason for hiding this comment

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

Per #467 (comment), this would not have a patch call...

@adiroiban adiroiban merged commit 41482c4 into trunk Aug 19, 2016
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.

None yet

4 participants