piotrek204
piotrek204

Reputation: 21

pkg_resources.get_distribution() returns diffrent path to location when pyproject.toml is used

I have a python project that is installed via setup.py. I usually install it as editable install:

py -3 -m pip install -e <path_to_my_project>

before I added pyproject.toml, execution of such an instruction:

import pkg_resources
pkg_resources.get_distribution('my-project')`

returned:

my-project 0.0.0 (<path_to_my_project>)

After adding pyproject.toml (empty), the execution of this instruction looks like this:

my-project 0.0.0 (c:\users\<user>\appdata\local\programs\python\python310-32\lib\site-packages)

What should be added to pyproject.toml to have backward compatibility?

My setup.py looks as followS:

from setuptools import setup, find_packages

setup(
    name='my-project',
    packages=find_packages(where='src'),
    package_dir={"": "src"},
)

I tried https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#fallback-behaviour

Upvotes: 0

Views: 454

Answers (0)

Related Questions