▲ 319 ▼ Package managers be like (linux.community) submitted 2 years ago by ExLisper@linux.community to c/programmerhumor@lemmy.ml 156 comments fedilink hide all child comments Sorry Python but it is what it is.
[–] JakobDev@feddit.de 12 points 2 years ago (1 child) Pip stores nothing in a text file permalink fedilink source parent hideshow 2 child comments replies: [–] theFibonacciEffect@feddit.de 1 point 2 years ago (2 children) If you want to export your local environment, isn't usually a requirements.txt used? permalink fedilink source parent hideshow 4 child comments replies: [–] farent@lemmy.scam-mail.me 6 points 2 years ago Isn't it called a requirements.txt because it's used to export your project requirements (dependencies), not all packages installed in your local pip environment? permalink fedilink source parent [–] JakobDev@feddit.de 5 points 2 years ago (1 child) Yes, but this file is created by you and not pip. It's not like package.json from npm. You don't even need to create this file. permalink fedilink source parent hideshow 2 child comments replies: [–] theFibonacciEffect@feddit.de 2 points 2 years ago (2 children) Well if the file would be created by hand, that's very cumbersome. But what is sometimes done to create it automatically is using pip freeze > requirements. txt inside your virtual environment. You said I don't need to create this file? How else will I distribute my environment so that it can be easily used? There are a lot of other standard, like setup.py etc, so it's only one possibility. But the fact that there are multiple competing standard shows that how pip handles this is kinds bad. permalink fedilink source parent hideshow 4 child comments replies: [–] JakobDev@feddit.de 2 points 2 years ago If you try to keep your depencies low, it's not very cumbersome. I usually do that. A setup.py/pyproject.toml can replace requirements. txt, but it is for creating packages and does way more than just installing dependencies, so they are not really competing. For scripts which have just 1 or 2 packges as depencies it's also usuall to just tell people to run pip install . permalink fedilink source parent [–] Vash63@lemmy.world 2 points 2 years ago I work with python professionally and would never do that. I add my actual imports to the requirements and if I forget I do it later as the package fails CI/CD tests. permalink fedilink source parent
[–] theFibonacciEffect@feddit.de 1 point 2 years ago (2 children) If you want to export your local environment, isn't usually a requirements.txt used? permalink fedilink source parent hideshow 4 child comments replies: [–] farent@lemmy.scam-mail.me 6 points 2 years ago Isn't it called a requirements.txt because it's used to export your project requirements (dependencies), not all packages installed in your local pip environment? permalink fedilink source parent [–] JakobDev@feddit.de 5 points 2 years ago (1 child) Yes, but this file is created by you and not pip. It's not like package.json from npm. You don't even need to create this file. permalink fedilink source parent hideshow 2 child comments replies: [–] theFibonacciEffect@feddit.de 2 points 2 years ago (2 children) Well if the file would be created by hand, that's very cumbersome. But what is sometimes done to create it automatically is using pip freeze > requirements. txt inside your virtual environment. You said I don't need to create this file? How else will I distribute my environment so that it can be easily used? There are a lot of other standard, like setup.py etc, so it's only one possibility. But the fact that there are multiple competing standard shows that how pip handles this is kinds bad. permalink fedilink source parent hideshow 4 child comments replies: [–] JakobDev@feddit.de 2 points 2 years ago If you try to keep your depencies low, it's not very cumbersome. I usually do that. A setup.py/pyproject.toml can replace requirements. txt, but it is for creating packages and does way more than just installing dependencies, so they are not really competing. For scripts which have just 1 or 2 packges as depencies it's also usuall to just tell people to run pip install . permalink fedilink source parent [–] Vash63@lemmy.world 2 points 2 years ago I work with python professionally and would never do that. I add my actual imports to the requirements and if I forget I do it later as the package fails CI/CD tests. permalink fedilink source parent
[–] farent@lemmy.scam-mail.me 6 points 2 years ago Isn't it called a requirements.txt because it's used to export your project requirements (dependencies), not all packages installed in your local pip environment? permalink fedilink source parent
[–] JakobDev@feddit.de 5 points 2 years ago (1 child) Yes, but this file is created by you and not pip. It's not like package.json from npm. You don't even need to create this file. permalink fedilink source parent hideshow 2 child comments replies: [–] theFibonacciEffect@feddit.de 2 points 2 years ago (2 children) Well if the file would be created by hand, that's very cumbersome. But what is sometimes done to create it automatically is using pip freeze > requirements. txt inside your virtual environment. You said I don't need to create this file? How else will I distribute my environment so that it can be easily used? There are a lot of other standard, like setup.py etc, so it's only one possibility. But the fact that there are multiple competing standard shows that how pip handles this is kinds bad. permalink fedilink source parent hideshow 4 child comments replies: [–] JakobDev@feddit.de 2 points 2 years ago If you try to keep your depencies low, it's not very cumbersome. I usually do that. A setup.py/pyproject.toml can replace requirements. txt, but it is for creating packages and does way more than just installing dependencies, so they are not really competing. For scripts which have just 1 or 2 packges as depencies it's also usuall to just tell people to run pip install . permalink fedilink source parent [–] Vash63@lemmy.world 2 points 2 years ago I work with python professionally and would never do that. I add my actual imports to the requirements and if I forget I do it later as the package fails CI/CD tests. permalink fedilink source parent
[–] theFibonacciEffect@feddit.de 2 points 2 years ago (2 children) Well if the file would be created by hand, that's very cumbersome. But what is sometimes done to create it automatically is using pip freeze > requirements. txt inside your virtual environment. You said I don't need to create this file? How else will I distribute my environment so that it can be easily used? There are a lot of other standard, like setup.py etc, so it's only one possibility. But the fact that there are multiple competing standard shows that how pip handles this is kinds bad. permalink fedilink source parent hideshow 4 child comments replies: [–] JakobDev@feddit.de 2 points 2 years ago If you try to keep your depencies low, it's not very cumbersome. I usually do that. A setup.py/pyproject.toml can replace requirements. txt, but it is for creating packages and does way more than just installing dependencies, so they are not really competing. For scripts which have just 1 or 2 packges as depencies it's also usuall to just tell people to run pip install . permalink fedilink source parent [–] Vash63@lemmy.world 2 points 2 years ago I work with python professionally and would never do that. I add my actual imports to the requirements and if I forget I do it later as the package fails CI/CD tests. permalink fedilink source parent
[–] JakobDev@feddit.de 2 points 2 years ago If you try to keep your depencies low, it's not very cumbersome. I usually do that. A setup.py/pyproject.toml can replace requirements. txt, but it is for creating packages and does way more than just installing dependencies, so they are not really competing. For scripts which have just 1 or 2 packges as depencies it's also usuall to just tell people to run pip install . permalink fedilink source parent
[–] Vash63@lemmy.world 2 points 2 years ago I work with python professionally and would never do that. I add my actual imports to the requirements and if I forget I do it later as the package fails CI/CD tests. permalink fedilink source parent