prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.08k stars 172 forks source link

pixi does not recognise updates to pyproject [project.scripts]. #1881

Open brettc opened 1 month ago

brettc commented 1 month ago

Checks

Reproducible example

Set up a new python project

mkdir pixi-bug
cd pixi-bug
pixi init --format pyproject
mkdir -p src/pixi_bug
touch src/pixi_bug/__init__.py
pixi install

Create the following file at src/pixi_bug/hello.py

def main():
    print("Hello")

if __name__ == "__main__":
    main()

Test that it works (you should see "Hello" printed).

pixi run python src/pixi_bug/hello.py

Now try to install this as a script. Add this section to the pyproject.toml

[project.scripts]
hello = "pixi_bug:hello.main"

Try to re-install the project and run your new script:

pixi install
pixi run hello

Nope, you get : hello: command not found

However, it works if you blow everything away and install:

rm -rf .pixi
pixi install 
pixi run hello

Conclusion: pixi install does not detect changes to [project.scripts] section.

Issue description

As per title.

Expected behavior

Changes to project.scripts should trigger a new install?

baszalmstra commented 1 month ago

Since we leave all of this up to uv is that a bug on their side @tdejager ?

tdejager commented 1 month ago

When trying the reproducer I think this is actually a bug on our side, because we do most of the validation logic if the correct package is installed ourself. It seems that for some reason it's not hitting validation check where it should.

Something we need to look into.