Skip to content

#2197: fixed-python-integration#2205

Open
JoelAdbu wants to merge 2 commits into
devonfw:mainfrom
JoelAdbu:bug-fix/2197-python-integration-broken
Open

#2197: fixed-python-integration#2205
JoelAdbu wants to merge 2 commits into
devonfw:mainfrom
JoelAdbu:bug-fix/2197-python-integration-broken

Conversation

@JoelAdbu

@JoelAdbu JoelAdbu commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2197

Implemented changes:

  • added UV_PROJECT_ENVIRONMENT environment variable for python installations.
  • added test for UV_PROJECT_ENVIRONMENT environment setup.

Testing instructions

Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:

Prerequisites

  1. Create a new IDEasy project:
ide create <project-name>
  1. Change to the workspace:
cd <project-name>/workspaces/main
  1. Create a pyproject.toml file in the workspace root:
[project]
name = "test-project"
version = "0.1.0"
dependencies = [
    "requests",
    "pandas"
]

Reproduce Current Behavior

  1. Open a new Git Bash and run:
ide install python
  1. Check that only VIRTUAL_ENV is set:
echo $VIRTUAL_ENV

Expected:

/c/.../software/python
  1. Check that UV_PROJECT_ENVIRONMENT is not set:
echo $UV_PROJECT_ENVIRONMENT
  1. Run uv Sync
uv sync

Expected:

warning: `VIRTUAL_ENV=.../software/python` does not match the project environment path `.venv`

and

Creating virtual environment at: .venv
  1. Verify Incorrect Behavior
  • A .venv folder should have been created in the workspace`
  • The dependencies are installed into .venv instead of the IDEasy Python environment.

Cleanup Before Testing the Fix

  1. Remove the generated project environment:
rm -rf .venv
  1. Remove the lock file:
rm -f uv.lock
  1. Unset environment variables:
unset VIRTUAL_ENV
unset UV_PROJECT_ENVIRONMENT

4 . Remove the installed Python environment:

rm -rf ../<project_name>/software/python

Test the fix

  1. Checkout Branch containing the fix

  2. Build IDEasy Locally

./build-local-dev.sh

Wait until the build completes successfully.

  1. Close the current Git Bash window and open a new Git Bash in:
<project-name>/workspaces/main
  1. Install Python
ide install python
  1. verify Environment Variables
    Check:
echo $VIRTUAL_ENV
echo $UV_PROJECT_ENVIRONMENT

Expected for both:

/c/.../software/python
  1. Run uv Sync
uv sync

Result

The fix is successful if:

  • uv sync uses the IDEasy Python installation
  • Dependencies are installed into software/python
  • UV_PROJECT_ENVIRONMENT is set automatically
  • No warning about VIRTUAL_ENV
  • No .venv directory is created
  • No message:
Creating virtual environment at: .venv

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

- set UV_PROJECT_ENVIRONMENT for uv project commands
-added test to check if UV_PROJECT_ENVIROMENT is set
@JoelAdbu JoelAdbu self-assigned this Jul 23, 2026
@JoelAdbu JoelAdbu added python runtime for python language install installation process of IDE + tools and install commandlet uv fast Python package and project manager labels Jul 23, 2026
@JoelAdbu JoelAdbu moved this from 🆕 New to Team Review in IDEasy board Jul 23, 2026
@coveralls

coveralls commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 30004650583

Coverage increased (+0.05%) to 72.542%

Details

  • Coverage increased (+0.05%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/python/Python.java 1 76.92%

Coverage Stats

Coverage Status
Relevant Lines: 16959
Covered Lines: 12826
Line Coverage: 75.63%
Relevant Branches: 7584
Covered Branches: 4978
Branch Coverage: 65.64%
Branches in Coverage %: Yes
Coverage Strength: 3.2 hits per line

💛 - Coveralls

@JoelAdbu

Copy link
Copy Markdown
Contributor Author

This solution is based on the uv maintainers' recommendation:

Using UV_PROJECT_ENVIRONMENT allows uv project commands to use the IDEasy Python environment instead of creating a project-local .venv.

@MariusFreyer MariusFreyer self-assigned this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

install installation process of IDE + tools and install commandlet python runtime for python language uv fast Python package and project manager

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Python integration broken

3 participants