1,550 questions
Tooling
0
votes
1
replies
82
views
`dnf provides` for `pip`
I do a lot of building, so package errors cause the most friction. In particular, when working with pip, the ModuleNotFoundError: after all package names can be confusing / unexpected and not ...
4
votes
2
answers
288
views
How do I set uv to index packages from a local directory?
So, I have a built python wheel at $HOME/mypackages/mypackage-1.0.0-py3-none-any.whl. I want uv to use this mypackages/ directory as its default package index, so I set:
export UV_DEFAULT_INDEX="$...
Tooling
1
vote
2
replies
85
views
Python Package - Storing Configuration/Settings and delete when package is uninstalled
My python GUI application have settings. The state of the settings are saved to the user_configs_dir into a json file by using the appdirs library.
My python application can be installed using pip ...
1
vote
0
answers
78
views
Python module built with Cpp and scikit-build-core compiles with the wrong version of Numpy
I have the following pyproject.toml
[build-system]
requires = ["scikit-build-core>=0.11", "pybind11>=3.0", "numpy>=2.0"]
build-backend = "scikit_build_core....
1
vote
0
answers
100
views
Local package randomly becomes unimportable when using `uv run` in a project created with `uv init --package`
I'm seeing non-deterministic import failures when using uv to manage a Python project created with uv init --package. After a fresh uv sync, my local package is importable, but after running a few uv ...
1
vote
1
answer
68
views
Can't Import Module with Python Package with Subpackages All as Zip Archive
I am experimenting with how to package my python code as a zip archive. I understand there are other ways to share and distribute code. Right now I am specifically interested in how to get this to ...
2
votes
0
answers
210
views
What is the documented behaviour (if any) when someone imports `pkg.__init__[ as pkg]` instead of `import pkg`?
To be clear, I'm not suggesting anyone actually should import pkg.__init__ directly. This is to understand potential pitfalls if someone decides to convert a module-only distribution into a package, ...
3
votes
1
answer
102
views
Python packaging: single-module with package data
I want to install my single file module together with its py.typed file using setuptools and pyproject.toml.
I'm packaging a Python single-module, and so far I was using a very simple pyproject.toml:
[...
2
votes
2
answers
91
views
Unable to create .whl distribution for only one Python package
My goal is to create a .whl installer file for only one given package. There are multiple packages in the directory tree.
setup.py:
from setuptools import setup
setup(
name="package1",
...
0
votes
0
answers
185
views
How to automate running Mypy stubgen on build?
I am new to PyO3. Out of the box it supports building with maturin or setuptools-rust. It does not support making Python type stub (.pyi) files by itself yet (incomplete feature). Mypy's stubgen does ...
-2
votes
1
answer
106
views
Is it possible to install submodules of a python package dynamically?
I have a very complex Python library that is used by several people/projects for different purposes.
The structure is basically the same as many Python libraries, but I would like to give the ability ...
0
votes
0
answers
112
views
Setuptools : why editable mode does not work outside of my project directory?
I don't manage to make the editable mode pip install -e . for a local installation of my project. After the installation, when I import a constructor from a module of my package within in python shell ...
1
vote
2
answers
156
views
How do you use just one folder from a repository as a submodule?
I have a repository which needs just one folder from another, but it needs to keep updating when the other repo changes, so I plan to use a submodule, but how do I take just the singular folder?
This ...
-5
votes
1
answer
178
views
simplest jinja2 template loading for one-file python script
I'm using Python only for simple scripts and every time I look into Python packaging, there is a new standard or technologie.
Now when I develop a small one-file tool and want to load a jinja2 ...
0
votes
0
answers
73
views
Why does pip install incompatible packages from Google Artifact Registry (Python repo) instead of resolving properly?
I'm using Google Artifact Registry to host Python packages, and I'm running into a serious issue with pip installing incompatible versions of packages (like numpy or scipy)
Problem:
When I run:
pip ...