Skip to content

Add command to install pypi packages by pip#396

Merged
chennes merged 5 commits into
FreeCAD:devfrom
mnesarco:pip-install
May 19, 2026
Merged

Add command to install pypi packages by pip#396
chennes merged 5 commits into
FreeCAD:devfrom
mnesarco:pip-install

Conversation

@mnesarco
Copy link
Copy Markdown
Contributor

@mnesarco mnesarco commented May 19, 2026

2026-05-19.08-37-00.mp4

AddonManager code uses legacy patterns, so I tried to follow the style as much as possible to keep the changes minimal.

@mnesarco mnesarco marked this pull request as draft May 19, 2026 02:38
Comment thread addonmanager_python_deps_gui.py Fixed
@mnesarco mnesarco force-pushed the pip-install branch 2 times, most recently from 958fb5b to 61ed285 Compare May 19, 2026 13:02
Comment thread addonmanager_python_deps_gui.py Fixed
@mnesarco
Copy link
Copy Markdown
Contributor Author

I used the icon of PyPi for the command. I am not sure if we can use it.

@mnesarco mnesarco marked this pull request as ready for review May 19, 2026 13:08
@mnesarco
Copy link
Copy Markdown
Contributor Author

@chennes
probably _cleanup_old_package_versions does nothing because the whole vendor_path is replaced with a new one, but i left it untouched for know, you know better this code and all the portability gotchas.

@mnesarco
Copy link
Copy Markdown
Contributor Author

Ref: FreeCAD/FreeCAD#29903

@chennes
Copy link
Copy Markdown
Member

chennes commented May 19, 2026

I think we probably shouldn't use the PyPI logo: we're basically a pip frontend, and not actually associated with PyPI, PyPA, or PSF. If it was a link directly to pypi.org it would probably be OK, but as the logo for a command that peripherally uses PyPI it's probably not (or at least, not clearly-enough OK for us to use it).

@mnesarco
Copy link
Copy Markdown
Contributor Author

I think we probably shouldn't use the PyPI logo: we're basically a pip frontend, and not actually associated with PyPI, PyPA, or PSF. If it was a link directly to pypi.org it would probably be OK, but as the logo for a command that peripherally uses PyPI it's probably not (or at least, not clearly-enough OK for us to use it).

Ok, removed.

Comment thread addonmanager_python_deps_commands.py Fixed
@chennes
Copy link
Copy Markdown
Member

chennes commented May 19, 2026

This works fine as long as I apply #397 (oops). I notice there's no pip output to the console, though, which I thought was strange. Is that supposed to be happening?

@mnesarco
Copy link
Copy Markdown
Contributor Author

mnesarco commented May 19, 2026

I did't remove any console output, and tried to keep the changes minimal. Let me check if I broke something

@mnesarco
Copy link
Copy Markdown
Contributor Author

mnesarco commented May 19, 2026

What i can see is that pip output goes to log, not console? It was not changed.

Edit: No, this is not the Issue.

@mnesarco
Copy link
Copy Markdown
Contributor Author

Wait, in my local env I get full pip output in the console:

13:27:57  Running pip with the following command:
13:27:57  /usr/bin/python3 -m pip --disable-pip-version-check install --target /devel/FreeCAD_pixi/var/AdditionalPythonPackages/py311 cowsay ladybug bawr --break-system-packages --constraint https://raw.githubusercontent.com/FreeCAD/Addons/refs/heads/main/Data/Python/3.11/constraints.txt
13:28:00  Collecting cowsay
13:28:00    Using cached cowsay-6.1-py3-none-any.whl.metadata (5.6 kB)
13:28:00  Collecting ladybug
13:28:00    Using cached ladybug-0.16.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (4.7 kB)
13:28:00  Collecting bawr
13:28:00    Using cached bawr-0.0.11-py3-none-any.whl.metadata (10 kB)
13:28:00  Collecting Pillow (from bawr)
13:28:00    Using cached pillow-12.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (8.8 kB)
13:28:00  Collecting rectpack (from bawr)
13:28:00    Using cached rectpack-0.2.2-py3-none-any.whl
13:28:00  Using cached cowsay-6.1-py3-none-any.whl (25 kB)
13:28:00  Using cached ladybug-0.16.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.7 MB)
13:28:00  Using cached bawr-0.0.11-py3-none-any.whl (33 kB)
13:28:00  Using cached pillow-12.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.1 MB)
13:28:00  Installing collected packages: rectpack, Pillow, ladybug, cowsay, bawr
13:28:00  Successfully installed Pillow-12.2.0 bawr-0.0.11 cowsay-6.1 ladybug-0.16.1 rectpack-0.2.2
13:28:00  
13:28:00  Running pip with the following command:
13:28:00  /usr/bin/python3 -m pip --disable-pip-version-check list -o --path /devel/FreeCAD_pixi/var/AdditionalPythonPackages/py311
13:28:01  Running pip with the following command:
13:28:01  /usr/bin/python3 -m pip --disable-pip-version-check list --path /devel/FreeCAD_pixi/var/AdditionalPythonPackages/py311
13:28:01  Running pip with the following command:
13:28:01  /usr/bin/python3 -m pip --disable-pip-version-check list -o --path /devel/FreeCAD_pixi/var/AdditionalPythonPackages/py311
13:28:02  Running pip with the following command:
13:28:02  /usr/bin/python3 -m pip --disable-pip-version-check list --path /devel/FreeCAD_pixi/var/AdditionalPythonPackages/py311

@chennes chennes merged commit 933476e into FreeCAD:dev May 19, 2026
8 checks passed
@chennes chennes added in testing on dev branch This backport PR is still in testing on the dev branch and should not be merged yet. and removed in testing on dev branch This backport PR is still in testing on the dev branch and should not be merged yet. labels May 19, 2026
@chennes chennes added the release to main Trigger an Action to create a PR backporting to `main` label May 19, 2026
@github-actions
Copy link
Copy Markdown

Successfully created backport PR for main:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release to main Trigger an Action to create a PR backporting to `main`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants