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

Drop Python 2 support #1158

Merged
merged 8 commits into from
Jun 20, 2020
Merged

Drop Python 2 support #1158

merged 8 commits into from
Jun 20, 2020

Conversation

filmor
Copy link
Member

@filmor filmor commented Jun 14, 2020

What does this implement/fix? Explain your changes.

Drops support for and all references to Python 2.

Does this close any currently open issues?

Can't find it right now, but I think we had an issue discussing this.

Any other comments?

-/-

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

// We needs to replace all public constants to static readonly fields to allow
// binary substitution of different Python.Runtime.dll builds in a target application.

public static string pyversion => _pyversion;
Copy link
Contributor

Choose a reason for hiding this comment

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

@filmor I think a unit test depends on these public properties

Copy link
Member Author

Choose a reason for hiding this comment

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

Which one? I was used in a few places, but only to check for Python 2 vs 3.

Copy link
Contributor

Choose a reason for hiding this comment

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

@filmor you already removed them actually from TestPythonEngineProperties.cs
Seems like this might require an entry in the changelog since its a breaking change technically

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I could do that, but pyversion etc. where never really consumables in the first place. I'd like to move the whole Runtime to internal as a single Changelog entry, no need to do this for every single component.

Copy link
Member

Choose a reason for hiding this comment

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

@filmor moving Runtime to internal deserves its own tracking issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed: #1167

@koubaa
Copy link
Contributor

koubaa commented Jun 19, 2020

@filmor have you tried just changing the runtime and leaving the tests as-is for a first pass? I looked through the runtime and didn't see a mistake so I think I would start by ruling out problems with the test updating (which can easily be done in a followon branch)

@filmor
Copy link
Member Author

filmor commented Jun 19, 2020

Not needed. The failures before were due to one place where I forgot to replace text_type by str and instead removed it entirely, so instead repr was called which was buggy at the time. I fixed that (and a few other missing replacements of long and a missing import of operator) and now tests are passing. I'm not a big fan of doing multiple PRs for the same "change".

@codecov-commenter
Copy link

codecov-commenter commented Jun 19, 2020

Codecov Report

Merging #1158 into master will decrease coverage by 0.27%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1158      +/-   ##
==========================================
- Coverage   86.53%   86.25%   -0.28%     
==========================================
  Files           1        1              
  Lines         297      291       -6     
==========================================
- Hits          257      251       -6     
  Misses         40       40              
Flag Coverage Δ
#setup_linux 64.94% <60.00%> (-0.04%) ⬇️
#setup_windows 72.50% <100.00%> (+0.45%) ⬆️
Impacted Files Coverage Δ
setup.py 86.25% <100.00%> (-0.28%) ⬇️

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 140a9b8...cc4211c. Read the comment docs.

setup.py Show resolved Hide resolved
Copy link
Member

@lostmsu lostmsu left a comment

Choose a reason for hiding this comment

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

OK by me after a couple minor fixes

// We needs to replace all public constants to static readonly fields to allow
// binary substitution of different Python.Runtime.dll builds in a target application.

public static string pyversion => _pyversion;
Copy link
Member

Choose a reason for hiding this comment

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

@filmor moving Runtime to internal deserves its own tracking issue.

src/tests/test_exceptions.py Outdated Show resolved Hide resolved
src/tests/_compat.py Outdated Show resolved Hide resolved
@lostmsu
Copy link
Member

lostmsu commented Jun 19, 2020

Also, if you don't increase the coverage back to the target, or lower the target a bit, it is going to complain on every subsequent PR.

@filmor
Copy link
Member Author

filmor commented Jun 19, 2020

The coverage is always against master, it will not repeatedly complain.

@lostmsu lostmsu self-requested a review June 20, 2020 00:42
@lostmsu lostmsu merged commit ec424bb into pythonnet:master Jun 20, 2020
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this pull request Jun 29, 2020
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.

4 participants