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

feature prepared for py311 #1923

Merged
merged 27 commits into from
Nov 14, 2023
Merged

feature prepared for py311 #1923

merged 27 commits into from
Nov 14, 2023

Conversation

ReimarBauer
Copy link
Member

@ReimarBauer ReimarBauer commented Aug 23, 2023

The PR enables python 3.11

Fixes #1750

Does this PR introduce a breaking change?
This PR enables newer packages of matplotlib, qt and their dependencies

If the changes in this PR are manually verified, list down the scenarios covered::
a build by boa was verified

boa convert meta.yaml
boa build .

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Does this PR results in some Documentation changes?
If yes, include the list of Documentation changes

Checklist:

@ReimarBauer ReimarBauer marked this pull request as draft August 23, 2023 15:53
@ReimarBauer
Copy link
Member Author

Tests not suceeded, a segfault stops it in a way that it looks good

tests/_test_mscolab/test_file_manager.py::Test_FileManager::test_fetch_operation_creator
Fatal Python error: Segmentation fault

@ReimarBauer ReimarBauer changed the title feat prepared for py311 feature prepared for py311 Aug 23, 2023
@ReimarBauer
Copy link
Member Author

ReimarBauer commented Aug 23, 2023

we need to lookup for grid_b, test_mss_plot_driver.py triggers this

2023-08-23T16:10:27.2407781Z Error message: keyword grid_b is not recognized; valid keywords are ['size', 'width', 'color', 'tickdir', 'pad', 'labelsize', 'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', 'label1On', 'label2On', 'length', 'direction', 'left', 'bottom', 'right', 'top', 'labelleft', 'labelbottom', 'labelright', 'labeltop', 'labelrotation', 'grid_agg_filter', 'grid_alpha', 'grid_animated', 'grid_antialiased', 'grid_clip_box', 'grid_clip_on', 'grid_clip_path', 'grid_color', 'grid_dash_capstyle', 'grid_dash_joinstyle', 'grid_dashes', 'grid_data', 'grid_drawstyle', 'grid_figure', 'grid_fillstyle', 'grid_gapcolor', 'grid_gid', 'grid_in_layout', 'grid_label', 'grid_linestyle', 'grid_linewidth', 'grid_marker', 'grid_markeredgecolor', 'grid_markeredgewidth', 'grid_markerfacecolor', 'grid_markerfacecoloralt', 'grid_markersize', 'grid_markevery', 'grid_mouseover', 'grid_path_effects', 'grid_picker', 'grid_pickradius', 'grid_rasterized', 'grid_sketch_params', 'grid_snap', 'grid_solid_capstyle', 'grid_solid_joinstyle', 'grid_transform', 'grid_url', 'grid_visible', 'grid_xdata', 'grid_ydata', 'grid_zorder', 'grid_aa', 'grid_c', 'grid_ds', 'grid_ls', 'grid_lw', 'grid_mec', 'grid_mew', 'grid_mfc', 'grid_mfcalt', 'grid_ms'].
2023-08-23T16:10:27.2408088Z Hint: Check used waypoints..
2023-08-23T16:10:27.2408636Z 2023-08-23 16:08:24 ERROR ERROR: <class 'owslib.util.ServiceException'> The data corresponding to your request is not available. Please check the times and/or path you have specified.
2023-08-23T16:10:27.2408644Z 
2023-08-23T16:10:27.2411462Z Error message: keyword grid_b is not recognized; valid keywords are ['size', 'width', 'color', 'tickdir', 'pad', 'labelsize', 'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', 'label1On', 'label2On', 'length', 'direction', 'left', 'bottom', 'right', 'top', 'labelleft', 'labelbottom', 'labelright', 'labeltop', 'labelrotation', 'grid_agg_filter', 'grid_alpha', 'grid_animated', 'grid_antialiased', 'grid_clip_box', 'grid_clip_on', 'grid_clip_path', 'grid_color', 'grid_dash_capstyle', 'grid_dash_joinstyle', 'grid_dashes', 'grid_data', 'grid_drawstyle', 'grid_figure', 'grid_fillstyle', 'grid_gapcolor', 'grid_gid', 'grid_in_layout', 'grid_label', 'grid_linestyle', 'grid_linewidth', 'grid_marker', 'grid_markeredgecolor', 'grid_markeredgewidth', 'grid_markerfacecolor', 'grid_markerfacecoloralt', 'grid_markersize', 'grid_markevery', 'grid_mouseover', 'grid_path_effects', 'grid_picker', 'grid_pickradius', 'grid_rasterized', 'grid_sketch_params', 'grid_snap', 'grid_solid_capstyle', 'grid_solid_joinstyle', 'grid_transform', 'grid_url', 'grid_visible', 'grid_xdata', 'grid_ydata', 'grid_zorder', 'grid_aa', 'grid_c', 'grid_ds', 'grid_ls', 'grid_lw', 'grid_mec', 'grid_mew', 'grid_mfc', 'grid_mfcalt', 'grid_ms'].
2023-08-23T16:10:27.2411591Z Hint: Check used waypoints.
2023-08-23T16:10:27.2411854Z ______________________ Test_VSec.test_repeated_locations _______________________
2023-08-23T16:10:27.2412205Z [gw6] linux -- Python 3.11.4 /opt/conda/envs/mss-develop-env/bin/python3.11
2023-08-23T16:10:27.2412214Z 
2023-08-23T16:10:27.2412385Z self = <test_mss_plot_driver.Test_VSec object at 0x7fd751515050>
2023-08-23T16:10:27.2412392Z 
2023-08-23T16:10:27.2412517Z     def test_repeated_locations(self):
2023-08-23T16:10:27.2412613Z         p1 = [45.00, 8.]
2023-08-23T16:10:27.2412707Z         p2 = [50.00, 12.]
2023-08-23T16:10:27.2412813Z         self.path = [p1, p1]
2023-08-23T16:10:27.2413013Z >       img = self.plot(mpl_vsec_styles.VS_TemperatureStyle_01(driver=self.vsec))
2023-08-23T16:10:27.2413021Z 
2023-08-23T16:10:27.2413148Z tests/_test_mswms/test_mss_plot_driver.py:95: 
2023-08-23T16:10:27.2413307Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2023-08-23T16:10:27.2413452Z tests/_test_mswms/test_mss_plot_driver.py:89: in plot
2023-08-23T16:10:27.2413575Z     return self.vsec.plot()
2023-08-23T16:10:27.2413898Z mslib/mswms/mss_plot_driver.py:541: in plot
2023-08-23T16:10:27.2414090Z     image = self.plot_object.plot_vsection(data, self.lats, self.lons,
2023-08-23T16:10:27.2414225Z mslib/mswms/mpl_vsec.py:224: in plot_vsection
2023-08-23T16:10:27.2414319Z     self._plot_style()
2023-08-23T16:10:27.2414462Z mslib/mswms/mpl_vsec_styles.py:355: in _plot_style
2023-08-23T16:10:27.2414615Z     self._latlon_logp_setup(orography=curtain_p[0, :])
2023-08-23T16:10:27.2414743Z mslib/mswms/mpl_vsec.py:135: in _latlon_logp_setup
2023-08-23T16:10:27.2414833Z     ax.grid(b=True)
2023-08-23T16:10:27.2415248Z /opt/conda/envs/mss-develop-env/lib/python3.11/site-packages/matplotlib/axes/_base.py:3194: in grid
2023-08-23T16:10:27.2415398Z     self.xaxis.grid(visible, which=which, **kwargs)
2023-08-23T16:10:27.2415715Z /opt/conda/envs/mss-develop-env/lib/python3.11/site-packages/matplotlib/axis.py:1660: in grid
2023-08-23T16:10:27.2416048Z     self.set_tick_params(which='major', **gridkw)
2023-08-23T16:10:27.2416388Z /opt/conda/envs/mss-develop-env/lib/python3.11/site-packages/matplotlib/axis.py:932: in set_tick_params
2023-08-23T16:10:27.2416528Z     kwtrans = self._translate_tick_params(kwargs)
2023-08-23T16:10:27.2416689Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

@ReimarBauer
Copy link
Member Author

ReimarBauer commented Aug 23, 2023

We missed the deprecation in matplotlib 3.5

matplotlib/matplotlib#25267 (comment)

@ReimarBauer
Copy link
Member Author

interestingly this version now shows the test which blocks all tests

@@ -96,7 +96,7 @@ jobs:
&& source /opt/conda/etc/profile.d/conda.sh \
&& source /opt/conda/etc/profile.d/mamba.sh \
&& mamba activate mss-${{ inputs.branch_name }}-env \
&& pytest -vv -n 6 --dist loadfile --max-worker-restart 0 tests \
&& pytest -vv -n 6 --dist loadfile --max-worker-restart 4 tests \
|| (for i in {1..5} \
Copy link
Member Author

Choose a reason for hiding this comment

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

solves the situation when a worker errors. without all tests of that worker in the queue would be skipped

- pygeoif <1.0.0
- isodate
- lxml
- netcdf4
- hdf4
- pillow
- pytz
- pyqt >=5, <5.13
- qt >=5.10, <5.13
- pyqt >=5.15.0
Copy link
Member Author

Choose a reason for hiding this comment

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

this is needed to get recent python versions used. This also enables updating a lot dependent packages.

# empty http_auth definition
server_url = "http://example.com"
http_auth = config_loader(dataset="MSS_auth")
assert http_auth == {}
data = auth.get_auth_from_url_and_name(server_url, http_auth, overwrite_login_cache=False)
assert data == (None, None)
# checking if the test setup changes this
assert constants.AUTH_LOGIN_CACHE == {}
Copy link
Member Author

Choose a reason for hiding this comment

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

this test on github sometimes seems like to have a bias from another test, related to TestMigration. It happens only here in serial tests. And it does not happen on each run. In that case at some point constants.AUTH_LOGIN_CACHE is not empty.

@ReimarBauer ReimarBauer marked this pull request as ready for review November 13, 2023 13:40
@matrss
Copy link
Collaborator

matrss commented Nov 14, 2023

I cannot get this to build with python 3.11, boa itself seems to break:

boa convert meta.yaml > recipe.yaml
boa build .

leads to:

AttributeError: 
"load()" has been removed, use

  yaml = YAML(typ='rt')
  yaml.load(...)

and register any classes that you use, or check the tag attribute on the loaded data,
instead of file "/home/icg149/mambaforge/envs/mssdev-py311/lib/python3.11/site-packages/boa/cli/convert.py", line 133

        ruamel.yaml.load("".join(rest_lines), ruamel.yaml.RoundTripLoader)

@@ -243,7 +243,6 @@ def fail_if_open_message_boxes_left():
except RuntimeError:
pass


Copy link
Collaborator

Choose a reason for hiding this comment

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

This change seems wrong to me. Top-level functions should be separated by 2 newlines according to pep8.

Copy link
Member Author

Choose a reason for hiding this comment

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

ouch, but there are more

#2093

Copy link
Collaborator

@matrss matrss left a comment

Choose a reason for hiding this comment

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

Using

mamba install python=3.11
mamba mambabuild .
mamba install --use-local mss

worked and after installing the dev dependencies the test suite passes as well. Starting msui looked good too.

Are there any blockers to get this up to py312 as well? I couldn't get my steps to work when I change 3.11 to 3.12, for some reason it tries to install an ancient mss version in the last step (mss-1.2.1-py27_0).

@ReimarBauer
Copy link
Member Author

I cannot get this to build with python 3.11, boa itself seems to break:

boa convert meta.yaml > recipe.yaml
boa build .

leads to:

AttributeError: 
"load()" has been removed, use

  yaml = YAML(typ='rt')
  yaml.load(...)

and register any classes that you use, or check the tag attribute on the loaded data,
instead of file "/home/icg149/mambaforge/envs/mssdev-py311/lib/python3.11/site-packages/boa/cli/convert.py", line 133

        ruamel.yaml.load("".join(rest_lines), ruamel.yaml.RoundTripLoader)

interesting, some other than
the problem is an inconsistancy in xmlschema, see

#2056

in the recipe - xmlschema <2.5.0 helps, but we should have a fix upstream

@ReimarBauer
Copy link
Member Author

Using

mamba install python=3.11
mamba mambabuild .
mamba install --use-local mss

worked and after installing the dev dependencies the test suite passes as well. Starting msui looked good too.

Are there any blockers to get this up to py312 as well? I couldn't get my steps to work when I change 3.11 to 3.12, for some reason it tries to install an ancient mss version in the last step (mss-1.2.1-py27_0).

once we can build basemap for py312 we can try
matplotlib/basemap#590

@ReimarBauer ReimarBauer merged commit be3e513 into develop Nov 14, 2023
4 checks passed
@ReimarBauer ReimarBauer deleted the py311 branch November 14, 2023 14:34
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.

Build for python 3.11 is blocked
3 participants