Skip to content

fix setup.py on Windows#294

Closed
flothesof wants to merge 2 commits intoToFuProject:develfrom
flothesof:fix_issue292
Closed

fix setup.py on Windows#294
flothesof wants to merge 2 commits intoToFuProject:develfrom
flothesof:fix_issue292

Conversation

@flothesof
Copy link
Copy Markdown
Contributor

This fixes the install problem I found in #292 when installing from source on Windows.

As a side note, it seems the setup.py is starting to get bloated. In particular, I noticed that get_version_tofu and updateversion do something very similar (like checking if git is working in the path to know if we are on master...). This would be a an area for refactoring.

@pep8speaks
Copy link
Copy Markdown

pep8speaks commented Nov 27, 2019

Hello @flothesof! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 154:5: E722 do not use bare 'except'

Comment last updated at 2019-11-27 15:20:33 UTC

@Didou09 Didou09 requested a review from lasofivec November 27, 2019 15:26
@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 27, 2019

Codecov Report

Merging #294 into devel will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #294      +/-   ##
==========================================
+ Coverage   41.05%   41.11%   +0.05%     
==========================================
  Files          79       79              
  Lines       23468    23432      -36     
==========================================
- Hits         9634     9633       -1     
+ Misses      13834    13799      -35
Impacted Files Coverage Δ
tofu/imas2tofu/__init__.py 80.95% <0%> (+49.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6988b9f...8c5f1dd. Read the comment docs.

@Didou09 Didou09 self-requested a review November 27, 2019 16:02
Copy link
Copy Markdown
Member

@Didou09 Didou09 left a comment

Choose a reason for hiding this comment

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

I'm not sure putting updateversion into setup.py is the best move, it prevents us from running it without import setup.py.
We first need to understand better why the source installation on Windows suddenly stopped working

Comment thread setup.py
def get_version_tofu(path=_HERE):


def updateversion(path=_HERE):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes and no...
I agree having updateversion defined in a standalone side module is a bit cumbersome because it seems it is only needed in the setup.py.

But this was done in order to allow travis (or us) run updateversion as a standalone without having to import setup.py (which would run it).

updateversion can be useful as a standalone when we want to force an update of the version number prior to running the setup.py, using for example:

python -c "import _updateversion as up; out = up.updateversion(); print(out)"

This is not possible anymore with this change.

Are you sure there is no other fix for issue #292 ? It used to work before, I don't get why it stopped working

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, thanks for reviewing. So it seems this should not be merged as such.
I believe then this needs more investigation.
I have no idea why it's broken under Windows. Too bad...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice,
Please also make sure the PR does not include the chages from PR #292 (i.e.: updateversion)
These are two independent changes, and as we discussed, I'm sure sure we can merge PR #292 as of now.
I suspect it is because you created your branch from the branch you had already created for PR #292 , right ?

Best practice : always branch from devel, a world where things are stable and validated, to make small incremental changes ;-)

@lasofivec
Copy link
Copy Markdown
Collaborator

So I'm confused, is this solution working now ?

@flothesof
Copy link
Copy Markdown
Contributor Author

flothesof commented Nov 27, 2019

No, this is broken and will not be fixed with this PR. I think @Didou09 was talking about PR #296 which incorporated these changes. I rewrote my history on #296 to take them out. Side note: I checked out from my previous branch to get an updated .gitignore since it was a common change :)

Closing since this will fix the problem.

@flothesof flothesof closed this Nov 27, 2019
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.

5 participants