astral-sh / packse

Python packaging scenarios
Apache License 2.0
93 stars 9 forks source link

Feature Request: Default `sdist: false` where not specified in scenario #163

Open notatallshaw opened 5 months ago

notatallshaw commented 5 months ago

For a simpler test environment for pip I am trying to avoid setting up multiple Python environment versions, packse requires Python 3.12+ so I am only running tests with a Python 3.12 environment.

Most scenarios in packse are set to Python 3.8, for most scenarios this is not relevant to the results of the test. However for a few scenarios it is actually important to resolve the scenario against the Python version specified.

To get pip to run as though it were Python 3.8 when it's Python environment is Python 3.12 I must use the --python-version flag, however this flag is incompatible with sdists.

I beleive, but correct me if I'm wrong, that packse will default to sdist: true when it's not explictly specified by the scenario. This is problematic, as it means I can not distinguish when it's required to process sdists or not, from the output of packse inspect.

zanieb commented 4 months ago

Hm interesting, we don't have this problem because we will still attempt to perform source distribution builds with a mismatched Python version to get metadata.

I think you should be able to tell if the source distribution matters based on the ResolverOptions like no_build

zanieb commented 4 months ago

I'm a little hesitant to default it to false since by in the real-world generally both are available.