on-internet
← Community

Injecting .pth file for auto instrumentation

Stack Overflow ·

I am developing a library that requires 'zero-touch' installation to inject a .pth file directly into the environment's site-packages directory (lib/python3.x/site-packages). While I am using Poetry for packaging, I’ve hit a roadblock: pyproject.toml is static, but the target path needs to be dynamic to account for varying Python versions (e.g., python3.9 vs. python3.11). How can I ensure that a simple pip install handles this injection automatically without requiring the developer to run additional CLI commands? Current pyproject.toml sections: [tool.setuptools.data-files] "lib/python3.x/site

Comments

Sign in or sign up to comment and upvote.

No comments yet.