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

Python3.10 #1648

Merged
merged 40 commits into from
Jun 8, 2022
Merged

Python3.10 #1648

merged 40 commits into from
Jun 8, 2022

Conversation

Matthew-Jennings
Copy link
Member

No description provided.

@Matthew-Jennings Matthew-Jennings marked this pull request as draft May 29, 2022 04:23
@Matthew-Jennings
Copy link
Member Author

So I think we have some success!

@Matthew-Jennings Matthew-Jennings marked this pull request as ready for review May 29, 2022 08:24
Copy link
Member

@SimonBiggs SimonBiggs left a comment

Choose a reason for hiding this comment

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

Some brilliant work here :)

There seems to be a few CI items that are a little unhappy still though...

@Matthew-Jennings
Copy link
Member Author

Matthew-Jennings commented May 29, 2022

Some brilliant work here :)

There seems to be a few CI items that are a little unhappy still though...

Latest changes might do the trick.

  • pylint appears to be throwing false positive E1101s (no-member) for pathlib.Path.joinpath() (see similar Github issue). I think its safe to disable these inline. COuld maybe disable more broadly, but not sure how best to do so.

  • pylint is suddenly throwing [E0601 (used-before-assignment) errors too. I've put in dummy assignments to satisfy pylint, but wonder whether it is acceptable to just simply disable E0601..

  • doctests were failing due to streamlit and an incompatibly version of protobuf. streamlit is pinned and updating it might help and is possibly a better long-term solution but I didn't investigate this due to a warning in pyproject.toml indicating the need for its pin.

  • no idea about the cypress tests..

exe = str(pathlib.Path(np.__file__).parents[4].joinpath("bin", "python"))
exe = str(
pathlib.Path(np.__file__).parents[4].joinpath("bin", "python")
) # pylint: disable=no-member
Copy link
Member

Choose a reason for hiding this comment

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

This need for no-member has me confused...

Copy link
Member Author

Choose a reason for hiding this comment

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

One possibility is that pylint somehow recognises that pathlib.Path(np.__file__).parents[4] could return an Exception (IndexError) and so joinpath() would not be a "member". Dunno.

@Matthew-Jennings
Copy link
Member Author

I think I got everything except the Mosaiq tests passing (notwithstanding that not every combination of test task, python version and OS are being tested!).

I'm likely not going to be able to spend any longer on this for a couple of days, but understand that:

  • the Mosaiq tests may need addressing before the merge
  • we'll need a changelog entry.

I'll try to revisit midweek. In the meantime, if anyone (@SimonBiggs, @dg1an3?) has a quick fix for the Mosaiq stuff they can add, I'd be very much obliged!

@SimonBiggs
Copy link
Member

  • pylint is suddenly throwing [E0601 (used-before-assignment) errors too. I've put in dummy assignments to satisfy pylint, but wonder whether it is acceptable to just simply disable E0601..

My rule of thumb, if a new pylint error is added I will initially add it to the list of ignored errors in the config file, and then at a later date decide whether or not to scour the repo and fix up all of those.

  • doctests were failing due to streamlit and an incompatibly version of protobuf. streamlit is pinned and updating it might help and is possibly a better long-term solution but I didn't investigate this due to a warning in pyproject.toml indicating the need for its pin.

Streamlit is okay to be upgraded, it just needs to stay pinned for end user installation for now. But, streamlit is stabalising significantly. So this might not be an issue. But if upgrading streamlit doesn't cause CI issues, it's fair game.

@Matthew-Jennings Matthew-Jennings mentioned this pull request May 30, 2022
@nlambriICH
Copy link
Collaborator

nlambriICH commented May 31, 2022

Or @nlambriICH, might you be interested in taking a swing at this?

@SimonBiggs I could give it a try, but I think someone more experienced than me might be more suitable.

As a sidenote, I see that here the tests Library / Tests (ubuntu, updates) (pull_request) and Library / Tests (windows, docs) (pull_request) are passing, whereas in #1638 they are failing, possibly due to Python3.9?

@SimonBiggs
Copy link
Member

possibly due to Python3.9?

Not actually due to 3.9. @Matthew-Jennings actually did quite a bit of work in here fixing the various tests by updating the required dependencies.

@Matthew-Jennings
Copy link
Member Author

Matthew-Jennings commented Jun 2, 2022

Or @nlambriICH, might you be interested in taking a swing at this?

@SimonBiggs I could give it a try, but I think someone more experienced than me might be more suitable.

As a sidenote, I see that here the tests Library / Tests (ubuntu, updates) (pull_request) and Library / Tests (windows, docs) (pull_request) are passing, whereas in #1638 they are failing, possibly due to Python3.9?

Hi @nlambriICH, if you're up for it, you could have a go! I'm likely out until next week now - I won't have access to a suitable workstation for coding. But I can still review PRs, etc.

I think the way to go would be to:

  1. create a new branch/pull request from this branch (python3.10)
  2. try removing the sqlalchemy pin in pyproject.toml and run poetry update and poetry install -E dev. You may need to specifically run poetry update sqlalchemy
  3. Push to Github and see whether the Mosaiq tests fail and, if so, begin troubleshooting
    • if it does fail, it may be because of a different reason that it's failing now. I.e. it may fail because upgrading sqlalchemy broke the Mosaiq database test code, as opposed to whatever reason the test is failing now (which upgrading sqlalchemy may fix!)
    • If upgrading sqlalchemy does make it fail (differently), have a look at the sqlalchemy release notes. They may have introduced some relevant breaking changes between our currently pinned version and the latest version. See if you can identify a culprit - with luck it might be fairly simple - e.g. a change in function name/parameters?

Don't worry about all of that if you're not keen. I only write this since you expressed interest in trying!

@Matthew-Jennings
Copy link
Member Author

Hi @nlambriICH, if you're up for it, you could have a go! I'm likely out until next week now - I won't have access to a suitable workstation for coding. But I can still review PRs, etc.

I think the way to go would be to:

  1. create a new branch/pull request from this branch (python3.10)

  2. try removing the sqlalchemy pin in pyproject.toml and run poetry update and poetry install -E dev. You may need to specifically run poetry update sqlalchemy

  3. Push to Github and see whether the Mosaiq tests fail and, if so, begin troubleshooting

    • if it does fail, it may be because of a different reason that it's failing now. I.e. it may fail because upgrading sqlalchemy broke the Mosaiq database test code, as opposed to whatever reason the test is failing now (which upgrading sqlalchemy may fix!)
    • If upgrading sqlalchemy does make it fail (differently), have a look at the sqlalchemy release notes. They may have introduced some relevant breaking changes between our currently pinned version and the latest version. See if you can identify a culprit - with luck it might be fairly simple - e.g. a change in function name/parameters?

Don't worry about all of that if you're not keen. I only write this since you expressed interest in trying!

I had a small stab at this to no avail. Though my SQL skills are little more than "beginner" level.

@SimonBiggs
Copy link
Member

I had a small stab at this to no avail. Though my SQL skills are little more than "beginner" level.

Alright, having these tests not pass is blocking other PRs being able to be merged. I'll give this a crack.

@SimonBiggs
Copy link
Member

Given this is merging into the other Python 3.10 branch, I'll merge this into there and work on it further there.

@SimonBiggs SimonBiggs merged commit 8e04580 into 3.10-precursor Jun 8, 2022
@SimonBiggs SimonBiggs deleted the python3.10 branch June 8, 2022 06:00
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

5 participants