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 Allure reporting, update Python version test matrix, and prune test_api_build.py #4621

Merged
merged 54 commits into from
Dec 14, 2022

Conversation

sven6002
Copy link
Contributor

@sven6002 sven6002 commented Nov 4, 2022

Description

Miscellaneous improvements:

  • Adds Allure reporting
  • Updates the Python version test matrix
  • Prunes tests from test_api_build.py

Resolves #4558

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Update / Remove necessary tests?
  • Add / update outdated docustring?

@conda-bot
Copy link
Contributor

We require contributors to sign our Contributor License Agreement and we don't have one on file for @sven6002.

In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@travishathaway travishathaway linked an issue Nov 17, 2022 that may be closed by this pull request
3 tasks
@sven6002 sven6002 marked this pull request as ready for review November 23, 2022 15:26
@@ -1 +1 @@
I am a bad file that should not pass compileall.
"I am a bad file that should not pass compileall"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"I am a bad file that should not pass compileall"
I am a bad file that should not pass compileall.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is a .py file it will fail to recognize the file itself... it wont matter what is inside the file..

Copy link
Member

Choose a reason for hiding this comment

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

This is used for tests that compile .py to .pyc via conda_build.post.compile_missing_pyc.
f2_bad.py is intentionally a Python script with invalid syntax.
We test that compile_missing_pyc does not produce the corresponding .pyc for it but also does not fail the build.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see, the test is effectively doing:

python -Wi -m py_compile f1.py f2_bad.py f3.py

Unfortunately, Python 3.10 reworked py_compile so it stops compiling after encountering the first error. We can silence the error with the new --quiet argument but that doesn't result in the remaining files being compiled.

So it doesn't look like this test is possible anymore without batching the compiling in which case the test feels moot?

Copy link
Contributor

@dholth dholth left a comment

Choose a reason for hiding this comment

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

no \ on macosx

@beeankha beeankha added the source::anaconda created by members of Anaconda, Inc. label Dec 7, 2022
dholth and others added 5 commits December 13, 2022 17:51
Python 3.10 and numpy 1.16 are not compatible so to move forward with supporting Python 3.10 and soon 3.11 we will need to also bump up the default numpy variant.
These tests utilized a bad glob pattern that assumes only 2 digit Python version (e.g., py37, py38, py39) but fails for valid 3 digit versions (e.g., py310, py311).
'python': f'{sys.version_info.major}.{sys.version_info.minor}',
'numpy': '1.16',
"python": f"{sys.version_info.major}.{sys.version_info.minor}",
"numpy": "1.21",
Copy link
Contributor

Choose a reason for hiding this comment

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

The default numpy variant (1.16) is not compatible with Python 3.10, i.e., the following fails:

$ conda create -n scratch python=3.10 numpy=1.16

so we bump the minimum variant up to 1.21 (the minimum numpy variant was last bumped up in Jan 2021 from 1.11 to 1.16 in ff35940):

$ conda search 'numpy * py310*'
Loading channels: done
# Name                       Version           Build  Channel
numpy                         1.21.2 py310h2cbf25c_0  pkgs/main
numpy                         1.21.2 py310h7b614ad_0  pkgs/main
numpy                         1.21.5 py310h1ad2b02_1  pkgs/main
numpy                         1.21.5 py310h1ad2b02_2  pkgs/main
numpy                         1.21.5 py310h6c44a92_3  pkgs/main
numpy                         1.21.5 py310hdcd3fac_1  pkgs/main
numpy                         1.21.5 py310hdcd3fac_2  pkgs/main
numpy                         1.21.5 py310hdcd3fac_3  pkgs/main
numpy                         1.22.3 py310h1ad2b02_0  pkgs/main
numpy                         1.22.3 py310hdcd3fac_0  pkgs/main
numpy                         1.23.1 py310h6c44a92_0  pkgs/main
numpy                         1.23.1 py310hdcd3fac_0  pkgs/main
numpy                         1.23.3 py310h6c44a92_0  pkgs/main
numpy                         1.23.3 py310h6c44a92_1  pkgs/main
numpy                         1.23.3 py310hc1140d4_0  pkgs/main
numpy                         1.23.3 py310hc1140d4_1  pkgs/main
numpy                         1.23.4 py310h9638375_0  pkgs/main
numpy                         1.23.4 py310he50c29a_0  pkgs/main

conda list -p "%PREFIX%" --canonical
if errorlevel 1 exit 1
conda list -p "%PREFIX%" --canonical | grep "conda-build-test-numpy-build-run-1\.0-py..h......._0"
Copy link
Contributor

Choose a reason for hiding this comment

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

This glob pattern is problematic once we start testing with Python 3.10. Notice the py..h pattern near the end, this will successfully match py38 and py39 but not py310 or py311. Replaced this explicit pattern with a more fuzzy py.* pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is not within the scope of this PR.. I'll make the change for it in the next ticket..

Copy link
Contributor

@kenodegard kenodegard Dec 14, 2022

Choose a reason for hiding this comment

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

this was required to get tests to pass (and has already been implemented in this PR, see fac2add)

Copy link
Contributor

Choose a reason for hiding this comment

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

this is a side effect of changing the Python versions being tested

@dholth
Copy link
Contributor

dholth commented Dec 14, 2022

@kenodegard thanks for making the tests pass. Let's figure out how to merge this PR and do any improvements in a new short-lived PR.

@kenodegard kenodegard changed the title Conda build 4558 Add Allure reporting and update Python version test matrix Dec 14, 2022
@kenodegard kenodegard changed the title Add Allure reporting and update Python version test matrix Add Allure reporting, update Python version test matrix, and prune test_api_build.py Dec 14, 2022
@kenodegard kenodegard merged commit daeda52 into main Dec 14, 2022
@kenodegard kenodegard deleted the conda-build-4558 branch December 14, 2022 18:51
@sven6002
Copy link
Contributor Author

Dooone

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Dec 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity source::anaconda created by members of Anaconda, Inc.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Prune test_api_build.py relevant test
6 participants