sdispater | 7 years ago | on: Pipenv: promises a lot, delivers very little
sdispater's comments
sdispater | 7 years ago | on: Pipenv: promises a lot, delivers very little
Poetry does create virtualenvs to install dependencies on a per-project basis.
sdispater | 7 years ago | on: Poetry: Python dependency management and packaging made easy
It's also a packaging tool, which means you can build and publish packages with (on PyPI for instance).
And finally, it always creates a virtualenv for each project so that you always work isolated from the global Python installation.
sdispater | 8 years ago | on: Show HN: Poetry – Python dependency management and packaging made easy
In details:
oslo.utils==1.4.0 requires:
- pbr (>= 0.6, != 0.7, < 1.0) - oslo.i18n (>= 1.3)
So, poetry will take the latest version of oslo.i18n which requires:
- pbr (!= 2.1, >= 2.0)
Poetry will detect the conflict and backtrack oslo.i18n to version 2.1.0 which requires:
- pbr (>= 0.11, < 2.0)
This is compatible with the requirements of oslo.utils and pbr==0.11.1 will be installed
sdispater | 8 years ago | on: Show HN: Poetry – Python dependency management and packaging made easy
It is both a dependency management tool and a packaging tool. Most of the reasons why I started this are detailed in the README (along with why I don’t want to use Pipenv) here: https://github.com/sdispater/poetry#why, but if you want to know the advantages of Poetry compared to existing tools, here are a few:
- Exhaustive dependency resolver
- Intuitive CLI (See https://poetry.eustace.io/docs/cli/)
- Emphasis on semantic versioning and constraint specification so that wildcard dependencies (`*`) will be considered bad practice
- Support for dependencies caret, tilde, wildcard, inequality and multiple requirements.
- Only one file: the standardised pyproject.toml which aims at being readable and clear.
- Mandatory compatible python versions specification.
Also, Poetry is Python 3.6+ only but can manage Python 2 projects without any problem.
And finally, Poetry is not completely stable yet so internally things can change but the CLI and commands are pretty much stable so backwards-incompatible changes should not happen too often.
sdispater | 8 years ago | on: Poetry: Python dependency management and packaging made easy
It is both a dependency management tool and a packaging tool. Note that for the moment the focus has been on the dependency management part but the work on the packaging/publishing has started and is ready for simple, pure-python projects.
Most of the reasons why I started this are detailed in the README (along with why I don’t want to use Pipenv) but if you want to know the advantages of Poetry compared to existing tools, here are a few:
- Exhaustive dependency resolver
- Intuitive CLI (See [Commands](https://github.com/sdispater/poetry#commands))
- Emphasis on semantic versioning and constraint specification so that wildcard dependencies (`*`) will be considered bad practice
- Support for dependencies caret, tilde, wildcard, inequality and multiple requirements.
- Only one file: the standardised `pyproject.toml` which aims at being readable and clear.
- Mandatory compatible python versions specification.
This project is a revamped version of [pypoet](https://github.com/sdispater/poet) to have a cleaner codebase.
Be aware that not all the features described in the README are implemented yet (but most of them are).
Also, Poetry is Python 3.6+ only but can manage Python 2 projects without any problem.
And finally, Poetry is not stable yet so internally things can change but the CLI and commands are pretty much stable so backwards-incompatible changes should not happen too often.
sdispater | 8 years ago | on: Show HN: Pendulum – Python datetimes made easy
It’s now stable (since January actually) and has gain traction since I first introduced it, so I thought I’d share it here again so that it can be of use to more people.
For those wondering, Pendulum is a library for Python to ease datetimes, timedeltas and timezones manipulation.
Each Pendulum classes are subclasses of the standard classes so you can use them as drop-in replacements in your code (some exceptions exist, see https://pendulum.eustace.io/docs/#limitations)
Link to the official website: https://pendulum.eustace.io
Link to the official documentation: https://pendulum.eustace.io/docs/
Link to the github project: https://github.com/sdispater/pendulum
sdispater | 9 years ago | on: Poet – Package and dependency management for Python
I started building it because I wanted to have something simpler than what is currently existing.
Packaging system and dependency management in Python is rather convoluted and hard to understand for newcomers. Even for seasoned developers it might be cumbersome at times to create all files needed in a Python project: `setup.py`, `requirements.txt`, `setup.cfg`, `MANIFEST.in`.
So I wanted a tool that would limit everything to a single configuration file to do everything: dependency management, packaging and publishing.
It takes inspiration in tools that exist in other languages, like `composer` (PHP) or `cargo` (Rust). The `poetry.toml` file is really similar to the `Cargo.toml` one for example.
Note that there is no magic here, `poet` uses existing tools (`pip`, `twine`, `setuptools`, `distutils`, `pip-tools`) under the hood to achieve that in a more intuitive way.
I would also like to point out that, at this time, it is highly experimental and mostly still at a proof of concept stage but I’d gladly appreciate feedback and pull requests to improve it.
sdispater | 9 years ago | on: Pendulum (Python datetimes made easy) reaches its first stable version
sdispater | 9 years ago | on: Pendulum (Python datetimes made easy) reaches its first stable version
It provides objects and classes that directly inherits from the standard library ones so you can use them transparently (exceptions exist, see https://github.com/sdispater/pendulum#limitations)
Basically, the Pendulum class is a replacement for the native datetime one with some useful and intuitive methods, the Interval class is intended to be a better timedelta class and the Period class is a datetime-aware timedelta. It also provides Date and Time classes (introduced in version 0.7.0).
Timezones are also easier to deal with: Pendulum will automatically normalize your datetime to handle DST transitions for you.
import pendulum
pendulum.create(2013, 3, 31, 2, 30, 0, 0, 'Europe/Paris’)
# 2:30 for the 31th of March 2013 does not exist
# so pendulum will return the actual time which is 3:30+02:00
'2013-03-31T03:30:00+02:00’
dt = pendulum.create(2013, 3, 31, 1, 59, 59, 999999, 'Europe/Paris’)
'2013-03-31T01:59:59.999999+01:00’
dt = dt.add(microseconds=1)
'2013-03-31T03:00:00+02:00’
dt.subtract(microseconds=1)
'2013-03-31T01:59:59.999998+01:00’
Note that on creation, the normalization behavior is configurable (see https://pendulum.eustace.io/docs/#timezones for more information).To those wondering: yes I know Arrow (http://crsmithdev.com/arrow/) exists but its flaws and strange API (you can throw almost anything at get() and it will do its best to determine what you wanted, for instance) motivated me to start this project. You can check why I think Arrow is flawed here: https://pendulum.eustace.io/faq/#why-not-arrow (or https://github.com/sdispater/pendulum#why-not-arrow)
Link to the official documentation: https://pendulum.eustace.io/docs/
Link to the github project: https://github.com/sdispater/pendulum
sdispater | 9 years ago | on: Maya – Python Datetimes for Humans
A lot of effort has been put into getting DST right so I hope it will be what you are looking for.
Disclaimer: I am the author of Pendulum :-)
sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
d1 = datetime(2012, 1, 1, 1, 2, 3, tzinfo=pytz.UTC)
d2 = datetime(2011, 12, 31, 22, 2, 3, tzinfo=pytz.UTC)
delta = d2 - d1
delta.days
-1
delta.seconds
75600
d1 = Pendulum(2012, 1, 1, 1, 2, 3)
d2 = Pendulum(2011, 12, 31, 22, 2, 3)
delta = d2 - d1
delta.days
0
delta.hours
-3sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
pendulum.set_weekend_days([pendulum.SUNDAY])sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
I think the best thing to do here is keep the current behavior (post-DST) but with an option to choose what you want exactly (post-DST, pre-DST)
sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
What is important here, I think, is that any time arithmetic is not affected by this normalization, so if you add an hour the difference will be an hour, so you don't really have to think about it.
sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
Also, Pendulum is not just about datetimes but also provides both the Interval class and Period class which are improvements over the native timedelta class.
And finally, it handles properly time shifting around DST transition times and normalization of datetimes when creating them which neither Delorean nor Arrow do well.
sdispater | 9 years ago | on: Pendulum – Python datetimes made easy
It is heavily inspired by [Carbon](http://carbon.nesbot.com) for PHP.
Basically, the Pendulum class is a replacement for the native datetime one with some useful and intuitive methods, the Interval class is intended to be a better time delta class and, finally, the Period class is a datetime-aware timedelta.
Timezones are also easier to deal with: Pendulum will automatically normalize your datetime to handle DST transitions for you.
import pendulum
pendulum.create(2013, 3, 31, 2, 30, 0, 0, 'Europe/Paris’)
# 2:30 for the 31th of March 2013 does not exist
# so pendulum will return the actual time which is 3:30+02:00
'2013-03-31T03:30:00+02:00’
dt = pendulum.create(2013, 3, 31, 1, 59, 59, 999999, 'Europe/Paris’)
'2013-03-31T01:59:59.999999+01:00’
dt = dt.add(microseconds=1)
'2013-03-31T03:00:00+02:00’
dt.subtract(microseconds=1)
'2013-03-31T01:59:59.999998+01:00’
To those wondering: yes I know [Arrow](http://crsmithdev.com/arrow/) exists but its flaws and strange API (you can throw almost anything at get() and it will do its best to determine what you wanted, for instance) motivated me to start this project. You can check why I think Arrow is flawed here: https://pendulum.eustace.io/faq/#why-not-arrowLink to the official documentation: https://pendulum.eustace.io/docs/
Link to the github project: https://github.com/sdispater/pendulum
I've never seen that error before.
Which version of Python do you use?
And feel free to create an issue on the issue tracker: https://github.com/sdispater/poetry/issues