Closed Djelibeybi closed 1 year ago
I'd rather not honestly. I try to stay away from blindly copying things. It makes it difficult to know when things are needed vs when they are cargo culted. Makes it very difficult to remove things in the future because it's difficult to know why something was added in the first place.
I'm happy to add pyenv/poetry specific things you use. I'm interested to know why/how you use them for photons though.
On Wed, 14 Sept 2022, 7:50 am Avi Miller, @.***> wrote:
This aligns our .gitignore with the one provided by GitHub for new repos that chose Python as the primary language.
Also, because I use PyENV and Poetry a lot, it'll save me a ton of effort because I keep forgetting to not commit those bits.
Signed-off-by: Avi Miller @.***
You can view, comment on, or merge this pull request online at:
https://github.com/delfick/photons/pull/116 Commit Summary
- 7a38e51 https://github.com/delfick/photons/pull/116/commits/7a38e5129d79b855dd07741b460667b3cacf4efb Upedate .gitignore to cover more python variations
File Changes
(1 file https://github.com/delfick/photons/pull/116/files)
- M .gitignore https://github.com/delfick/photons/pull/116/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947 (142)
Patch Links:
— Reply to this email directly, view it on GitHub https://github.com/delfick/photons/pull/116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2V5MUZNKBAYMHVEVG63LV6DZLHANCNFSM6AAAAAAQL25ULQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I use PyENV a lot, so all my various Photons clones have a .python-version
file at least. I'm also terrible at keeping Git branches clean, so I have multiple clones of a code base instead of multiple branches of a single clone.
Poetry is covered by the virtualenv stuff. I configure Poetry to store its virtualenv in the project in .venv
.
so I have multiple clones of a code base instead of multiple branches of a single clone.
I have no idea what this means
As for pyvenv, I use asdf-vm.com, it's very good and imo much better than the language specific ones that exist for all things. And because I use a virtualenv for everything, I make sure I use the correct python to make the virtualenv and then once I activate that virtualenv my python is the correct version without changing what python is activated outside the virtualenv.
And for my photons venv I use virtualenvwrapper which means I type "workon photons" to activate that virtualenv and it's kept in a hidden folder with other virtualenvs in my home folder. Avoids this problem for any project.
So why do you need poetry?
With only using virtualenv you can use pip to install photons into the virtualenv
> workon photons
> pip install -e "modules[tests]"
> pip install -e apps/interactor apps/arranger
> lifx lan:transform -- '{"power": "on"}'
I use Poetry for dependency management, particularly around version requirement conflicts. Photons' hard-coded versions can be a challenge. :)
I've heard of asdf
before, but never played with it. I'll have to give it a spin to see if it works with my idiosyncrasies. :)
Are there conflicts atm?
Nope.
do you have examples of where you've used poetry to get around the pinned dependencies?
I haven't used it to get around them, I use it to identify them: it's really good at surfacing which dependencies actually conflict. When working with Home Assistant that has 1000+ dependencies with a full test install, that's super important.
hahhahah, yeap, can imagine. It would be nice if I could have a lockfile but I don't like poetry and similar projects and pip itself is unlikely to get a lockfile anytime soon.
I used to think the simplicity of pip was great, older I get the more I realise bundler is definitely better.
This aligns our
.gitignore
with the one provided by GitHub for new repos that chose Python as the primary language.Also, because I use PyENV and Poetry a lot, it'll save me a ton of effort because I keep forgetting to not commit those bits.
Signed-off-by: Avi Miller me@dje.li