Skip to main content

pythonpath-project

This Python module allows to register to pip Python modules that are loaded from their dynamic libraries in the PYTHONPATH. pip registering the modules allow to add a module that is not pip installable in a Python package requirements.

How to use?

A Python module called pythonpath_project proposes to override the setuptools Python function to add a Python module using its name, its version ID and its actual definition location.

To install a module, a folder needs to be created with inside:

  • a pyproject.toml: It defines the code name and its dependancies
[build-system]
requires = ["setuptools", "pythonpath-project"]
build-backend = "setuptools.build_meta"

[project]
name = "YourModule"
dependencies = [...]
dynamic = ["version"]
  • a setup.py: It actually adds the module to the pip environment using the pythonpath_project module:
import os
import sys
#   Import setup from pythonpath_project instead of setuptools
from pythonpath_project import setup

def get_version():
    #   Python function to catch the installed module version to dynamically set it, it can also be hard writen
    sys.path.insert(0, os.environ["YOURMODULE_PYTHONPATH"])
    import YourModule
    # Replace with any way to get the code pip compatible version id
    return YourModule.__version__

setup(
    name="YourModule",
    get_version=get_version,
    packages_names=["YourModule"]
)

The installation procedure creates a fresh environment in which the module from imported, a module compatible python path will be required. It needs to be set provided in the environment variable YOURMODULE_PYTHONPATH where YOURMODULE is the module name in upper case.

Metadata

Release files for pythonpath-project 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythonpath-project 0.0.2
File Size Uploaded
pythonpath_project-0.0.2.tar.gz 2.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pythonpath-project 0.0.2
File Interpreter ABI Platform
pythonpath_project-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 5.6 kB

Release files / pythonpath_project-0.0.2.tar.gz

Download URL pythonpath_project-0.0.2.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
47e2f87eaabbdff51dcb2bca74ce510a6d10388a844eba152e5843c641ce771a
BLAKE2b-256 checksum
How to use checksums
4fc4649e43d5a4fe9ed337c009faeddeb53425227bea91aa5f4967b6fea1138c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / pythonpath_project-0.0.2-py3-none-any.whl

Download URL pythonpath_project-0.0.2-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69c3e14c7d0897710d3ea7cf302fe6c712e339cf170b4266ac656fcc5631908e
BLAKE2b-256 checksum
How to use checksums
4186c88321a627c7d7daf7773c0e771bc32493e4697123ec95ff30ca0be5c6e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page