delfick / photons

Python3.6+ asyncio framework for interacting with LIFX devices
https://photons.delfick.com
MIT License
73 stars 6 forks source link

Update .gitignore to cover more python variations #116

Closed Djelibeybi closed 1 year ago

Djelibeybi commented 1 year ago

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

delfick commented 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

File Changes

(1 file https://github.com/delfick/photons/pull/116/files)

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: @.***>

Djelibeybi commented 1 year ago

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.

Djelibeybi commented 1 year ago

Poetry is covered by the virtualenv stuff. I configure Poetry to store its virtualenv in the project in .venv.

delfick commented 1 year ago

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"}'
Djelibeybi commented 1 year ago

I use Poetry for dependency management, particularly around version requirement conflicts. Photons' hard-coded versions can be a challenge. :)

Djelibeybi commented 1 year ago

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. :)

delfick commented 1 year ago

Are there conflicts atm?

Djelibeybi commented 1 year ago

Nope.

delfick commented 1 year ago

do you have examples of where you've used poetry to get around the pinned dependencies?

Djelibeybi commented 1 year ago

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.

delfick commented 1 year ago

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.