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

Add support for Python 3.9 build testing #1018

Merged
merged 19 commits into from
Aug 18, 2020

Conversation

micahellison
Copy link
Member

First step of #1017 - add build steps for Python 3.9 in Travis. Allowing failures for now, until 3.9 is stable.

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • [n/a] I have tested this code locally.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • [n/a] I have written new tests for these changes, as needed.
  • [n/a] All tests pass.

@micahellison
Copy link
Member Author

This still needs some work. Issues to figure out:

  • before_install step
    • Failing on 3.9 Mac. Looks like the sed command behaves differently on MacOS, and I'm not sure how best to replace it with find-and-replace logic.
    • Failing on 3.9 Windows. It works fine on my local machine but maybe a different version of PowerShell is running on Travis.
    • Maybe we could do this more effectively with a Python command executed from the shell, and use the same command for all OSes.
  • I have somehow managed to add the 3.9 Linux build to allow_failures but not the others. I don't know why. I want all of them to be allowed to fail for now.
  • Some new test failures on the 3.9 Linux build.
    • Is behave just dying in the middle of tests?
    • Tests are failing due to the version string: "ERROR: Python version 3.9.0b5+ not supported." Is it the case that any beta Python build is not allowed to run jrnl now? And is that okay?

To anyone looking at this: feel free to offer thoughts and suggestions. I'll come back to this later this week.

@wren
Copy link
Member

wren commented Aug 3, 2020

Yeah, the sed command was a hack thrown in there when we didn't have to consider the other OSes. We should probably use the toml library we already load in our python dev deps.

@micahellison
Copy link
Member Author

I've resolved the allow_failures problem, and I've got it working on Mac and Linux (thanks for the help @wren) but I'm still struggling with Windows. It's installing 3.9.0b5 with choco install python --pre but I don't know where it's installing it, since there's also a Python 2.7 installation on this Windows machine, and Python isn't behaving quite like it does in the other Windows Python 3 builds.

I'll come back to this later but, as always, any help is appreciated.

@wren wren marked this pull request as draft August 9, 2020 18:58
@micahellison
Copy link
Member Author

Okay. I think this is about as good as I'm going to get this.

Windows is correctly using Python 3.9, but it can't install cryptography because there are no wheels available for Python 3.9. The alternative is building it from source, which feels like a bit much, and isn't very representative of Windows users anyway, as they are generally not going to take this approach.. Maybe it will work as we get closer to the release in October, or if not, we'll at least know about this issue when we cross that bridge.

@micahellison micahellison marked this pull request as ready for review August 15, 2020 21:30
.travis.yml Outdated
# ... and beyond!
- name: Python nightly on Linux
before_install:
- sed -i 's/^python = ">=3\.6\.0.*"$/python = "*"/' pyproject.toml
- sed -i 's/^python = ">=3\.7\.0.*"$/python = "*"/' pyproject.toml
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this use your new script ( .build/allow_all_python_version.py)?

wren
wren previously approved these changes Aug 16, 2020
Copy link
Member

@wren wren left a comment

Choose a reason for hiding this comment

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

Looks great with one minor comment. I'll be happy to merge if you don't want to fix it, just let me know.

@wren wren changed the title [WIP] [Build testing] Add Python 3.9 builds Add support for Python 3.9 build testing Aug 16, 2020
@wren wren added the build Issues related to the build pipeline label Aug 16, 2020
Copy link
Member

@wren wren left a comment

Choose a reason for hiding this comment

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

🐆

@wren wren merged commit 3c7dcba into jrnl-org:develop Aug 18, 2020
wren pushed a commit that referenced this pull request Oct 17, 2020
* First stab at adding Python 3.9 dev Travis builds
* Dynamically replace Python max version for Python 3.9 beta builds
* Fix allow_failures (3.9-dev, not 3.9) and fix Windows find-and-replace command to allow 3.9
* Fix allow_failures to allow all three Python 3.9 builds to fail
* Use platform-independent Python script to allow all Python versions for 3.9 builds
* Format changes and changing before_install to script for 3.9 builds
* Install toml module to make it possible to run version-changing script before install
* Properly populate before_install step with Mac and Windows Python 3.9, and remove extraneous unused python key
* Add refreshenv to get python3 path included in WIndows
* Ensure MacOS pyenv is up to date and attempt to reference Windows python3 directly
* Use bash-friendly paths in Windows and check to see exactly what the Python 3.9 executable is
* Confirm Python version in Windows and attempt to get pip a different way
* Fiddling with Windows python references
* Remove Python3.6 references and check for Python directory in root directory
* Add Python 3.9 path to Windows build
* Remove pip steps that should be unnecessary
* Add upgrade pip to Windows Python 3.9 build
* Attempt to resolve "access denied" error when upgrading pip on Windows
* Use allow_all_python_version TOML script in nightly build instead of sed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to the build pipeline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants