itertools.batched() is pretty neat.
This update just makes me thirstier for the next level optimizer currently in work. I think it's supposed to come out with 3.13.
How do you guys update python versions and all the libraries you have installed? I have multiple like
- pygame
- ptpython
- pandas
- Pillow
- icecream
- ... is it not a massive hassle to have to reinstall all of this with every new version and fight the old version on ubuntu?
Pyenv! Let the OS have its own version and work on whatever version you want, whenever.
Also pipx for cli tools. It creates isolated environments for every tool you install. And upgrading is one command away pipx reinstall-all --python (your pyenv)
.
You are 100% right, that's why we use virtual environments. Specifically we use poetry, which is fine.
Conda is, to the alternative already mentioned, a great way to keep different versions of python and it's packages for each project!
On Linux, I'd just build my own Python binaries and make them available. But you can also use pyenv for the same thing if you're ok with it.
Then, using poetry, I have different projects with isolated environments.
The deadsnakes ppa is quite awesome
PEP 688 sounds useful. Might have to have a play.
This broke Pytest for us, not sure if it's an us problem, pytest problem, or Python 3.12 problem. Basically, it uses a ton of RAM until it gets killed by the OOM (I'm running in a Docker container w/ 3GB max RAM limit).
I'll post back when I get it working, but that's blocking our upgrade for now. Will probably revisit in a couple months after we get some projects shipped so we don't fall too far behind.
How is it going ? Did you solve it, or find the cause yet ?
No, but we haven't really been trying.
Our tests are written in unittest
style, but run with unit test. Unfortunately, a large number of our tests rely on fixtures, as in loading a ton of data into a SQLite database and then running code against that. That's because we have DB queries all throughout our service logic, so it's quite a bit of spaghetti to try to mock the DB logic.
So instead of trying to fix the memory issues in pytest, we're refactoring our app to separate the DB calls from our service logic, which should let us easily mock the repository in our tests.
So short answer: no. Longer answer: I might be able to tell you in a few months if this approach fixes the issue.
Python
Welcome to the Python community on the programming.dev Lemmy instance!
📅 Events
Past
November 2023
- PyCon Ireland 2023, 11-12th
- PyData Tel Aviv 2023 14th
October 2023
- PyConES Canarias 2023, 6-8th
- DjangoCon US 2023, 16-20th (!django 💬)
July 2023
- PyDelhi Meetup, 2nd
- PyCon Israel, 4-5th
- DFW Pythoneers, 6th
- Django Girls Abraka, 6-7th
- SciPy 2023 10-16th, Austin
- IndyPy, 11th
- Leipzig Python User Group, 11th
- Austin Python, 12th
- EuroPython 2023, 17-23rd
- Austin Python: Evening of Coding, 18th
- PyHEP.dev 2023 - "Python in HEP" Developer's Workshop, 25th
August 2023
- PyLadies Dublin, 15th
- EuroSciPy 2023, 14-18th
September 2023
- PyData Amsterdam, 14-16th
- PyCon UK, 22nd - 25th
🐍 Python project:
- Python
- Documentation
- News & Blog
- Python Planet blog aggregator
💓 Python Community:
- #python IRC for general questions
- #python-dev IRC for CPython developers
- PySlackers Slack channel
- Python Discord server
- Python Weekly newsletters
- Mailing lists
- Forum
✨ Python Ecosystem:
🌌 Fediverse
Communities
- #python on Mastodon
- c/django on programming.dev
- c/pythorhead on lemmy.dbzer0.com
Projects
- Pythörhead: a Python library for interacting with Lemmy
- Plemmy: a Python package for accessing the Lemmy API
- pylemmy pylemmy enables simple access to Lemmy's API with Python
- mastodon.py, a Python wrapper for the Mastodon API