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

Support {python} placeholder #227

Merged
merged 2 commits into from
Oct 9, 2023
Merged

Support {python} placeholder #227

merged 2 commits into from
Oct 9, 2023

Conversation

mih
Copy link
Member

@mih mih commented Oct 9, 2023

This placeholder is expanded on execution of a container, rather than on configuration/addition. This helps use the same Python installation that is also executing the datalad-container code.

Previously, the docker-support code would expand and then hardcode sys.executable on configuring a container. This led to non-portable configuration (e.g., hardcoded python.exe on windows), and would fail to pick up the correct python installation in any case where the python entrypoint would not point to the correct one.

Closes #226
Almost does #224 (missing the platform path issue)

@codeclimate
Copy link

codeclimate bot commented Oct 9, 2023

Code Climate has analyzed commit 3fc0079 and detected 0 issues on this pull request.

View more on Code Climate.

@adswa
Copy link
Member

adswa commented Oct 9, 2023

The failures are due to dockerhubs rate limiting:

toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

@mih
Copy link
Member Author

mih commented Oct 9, 2023

@adswa Yeah, the test setup is not so nice. Locally this works now -- also on windows.

Copy link
Member

@adswa adswa left a comment

Choose a reason for hiding this comment

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

looks sensible to me

@yarikoptic
Copy link
Member

any idea on how many tests would fail if windows is added as a test env?

@mih
Copy link
Member Author

mih commented Oct 9, 2023

any idea on how many tests would fail if windows is added as a test env?

When I execute the tests on windows (minus anything metalad-related datalad/datalad-metalad#397 because I am working with PY3.12 right now), I see 8 failed, 13 passed.

A good chunk of the failures is simply #233, most of the rest is wrong path assumptions.

This placeholder is expanded on *execution* of a container, rather than
on configuration/addition. This helps use the same Python installation
that is also executing the datalad-container code.

Previously, the docker-support code would expand and then hardcode
`sys.executable` on configuring a container. This led to non-portable
configuration (e.g., hardcoded `python.exe` on windows), and would fail
to pick up the correct python installation in any case where the
`python` entrypoint would not point to the correct one.

Closes datalad#226
Closes datalad#224
@mih
Copy link
Member Author

mih commented Oct 9, 2023

Rebased after merge of #235

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (4782a7a) 94.59% compared to head (3fc0079) 94.59%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #227   +/-   ##
=======================================
  Coverage   94.59%   94.59%           
=======================================
  Files          25       25           
  Lines        1091     1092    +1     
=======================================
+ Hits         1032     1033    +1     
  Misses         59       59           
Files Coverage Δ
datalad_container/containers_add.py 89.67% <100.00%> (ø)
datalad_container/containers_run.py 84.84% <100.00%> (+0.23%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mih
Copy link
Member Author

mih commented Oct 9, 2023

Merging, given the approvals.

@mih mih merged commit ee2ddc8 into datalad:master Oct 9, 2023
5 checks passed
@mih mih deleted the noexe branch October 9, 2023 17:30
@yarikoptic yarikoptic added the minor Increment the minor version when merged label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support {python} placeholder for cmdspec
3 participants