python-packaging

Installing my project from testpypi gives me an error

Installing my project from testpypi gives me an error Question: I am learning how to package python projects and publish them and I ran into a problem I have been trying to solve ,but failed. I have this small project and I am trying to upload it to Testpypi I managed to upload it there …

Total answers: 1

Remove warning in PIPENV

How to fix "RuntimeWarning: Running interpreter doesn't sufficiently support code object introspection." warning when using pipenv? Question: Every time I run any pipenv command I’m getting this: C:Usersuser_nameAppDataLocalProgramsPythonPython311Libsite-packagespipenvvendorattr_make.py:876: RuntimeWarning: Running interpreter doesn’t sufficiently support code object introspection. Some features like bare super() or accessing class will not work with slotted classes. set_closure_cell(cell, cls) The command …

Total answers: 1

Python package with multiple "packages"?

Python package with multiple "packages"? Question: Assume I have a project which looks like uilities.py api_1.py api_2.py api_3.py foo.py bar.py baz.py The utilites and api calls does nothing by their own, but they form 90% of the contents of foo.py, bar.py and baz.py. The contents of foo.py, bar.py and baz.py. are very bare bones, including …

Total answers: 1

Cannot find a module imported by another module

Cannot find a module imported by another module Question: I have a file structure like this └── myproject ├── src ├── a.py ├── b.py module a contains a class that is imported in by module b like this: from src.a import some_class when I try to import b from another class: from myproject.src import b …

Total answers: 1

Importing Python libraries with hyphen in the name

Importing Python libraries with hyphen in the name Question: I create a Python library. It requires a Git repository and a name. I name it my-library and also inside the package folder my-package. How should I: install library my-library after I upload it to PyPI? import the package my-package after I install the library? Asked …

Total answers: 1

Using classes, functions or other objects from an installed package

Using classes, functions or other objects from an installed package Question: I successfully installed this package using pip: pip install functional-dependencies Output: Collecting functional-dependencies Downloading functional_dependencies-1.3.0-py2.py3-none-any.whl (33 kB) Installing collected packages: functional-dependencies Successfully installed functional-dependencies-1.3.0 which should provide tools for functional dependencies (FDs). However, trying to get FDs using the commands as per the documentation …

Total answers: 1

Using a python package in the current app and its child package

Using a python package in the current app and its child package Question: I have a FastAPI app that uses package A as a dependency. On every request to the FastAPI app, package A stores some request string in a ContextVar inside the package. The FastAPI app also uses package B. This package B uses …

Total answers: 1

Poetry cannot import from subfolders in scripts runned by "poetry run"

Poetry cannot import from subfolders in scripts runned by "poetry run" Question: Project structure is like this: . ├── README.md ├── pyproject.toml … my_project_name/ ├── moduleA.py ├── moduleB.py └── FolderC └── moduleC.py moduleA.py: from .moduleB import moduleB_func from .FolderC.moduleC import moduleC_func … script in pyproject.toml: funcA_run = my_project_name.moduleA:funcA (funcA function is just example – exception …

Total answers: 1

ERROR HTTPError: 400 Bad Request when building PyPi package

ERROR HTTPError: 400 Bad Request when building PyPi package Question: I’m trying to build my PyPi package and after I ran this command python3 -m twine upload –verbose –repository testpypi dist/* it gave me this error: Response from https://test.pypi.org/legacy/: 400 ‘0+untagged.2.g592d0aa’ is an invalid value for Version. Error: Can’t use PEP 440 local versions. See …

Total answers: 1