Conversation
Pull __version__ from the package's metadata directly
Closes #236
We are not using `attr:` anymore, so the `emanate` module does not need to be importable at setup time.
|
@duckinator There might be complications when merging this, since it will match the |
|
Oh, |
|
Oh FFS. Now it barfs up because of a dependency conflict with @duckinator, can we move away from specifying exact versions? |
|
@AstraLuma, I'd be interested in your opinion on this PR. 💜 |
emanate/__init__.py
Outdated
| import importlib_metadata as metadata # type: ignore | ||
|
|
||
| # Set the module-level dunders suggested in PEP8 | ||
| __author__ = metadata.metadata('emanate').get('author') |
There was a problem hiding this comment.
Is there a way to pass metadata the current module, instead of hardcoding a name?
|
Annoyingly, we presumably care about OpenSUSE (at least, @duckinator included it in versions.boop.ws) and even their current beta still ships Python 3.6 😭 |
|
@nbraud I can't really give this a proper review because GitHub is incomprehensible on a 1366x768 display, but:
|
OK, then there should be no special handling needed for this PR (moving the
Ayup. I'm not terribly-worried either about that polyfill.
OK.
Good to know. Given that I don't think we'd want to drop Py3.7 compatibility just yet, we need to deal with the polyfills anyway (and edge-cases like zipapps) so I guess we could keep Py3.6 compatibility so long as the On the other hand, it's in my experience a problematic library (badly maintained, had bugs that had been fixed in the Python stdlib for years, ...) so I'd be happy not to have a dependency on it, even a conditional one. |
|
Modified to use the |
Pinning exact versions makes software that share dependencies essentially-impossible to install in the same environment. See #243. We use the “compatible version” operator, `~=`, to specify version constraints, essentially assuming that our dependencies follow SemVer.
|
@nbraud This looks good to me — if you're happy with it, go ahead and merge it when you're ready. |
|
bors r=duckinator |
243: Define metadata in setup.cfg r=duckinator a=nbraud - [x] Move version number to `/version` file, define `__version__` based on package metadata That file doesn't need to be included in the built package, but stays separate for Cirrus to pick up on. - [x] Move author definition to `setup.cfg` - [x] Drop setup-time dependencies We aren't using `attr:` anymore in `setup.cfg`, so `emanate` needs not be importable at setup-time. I'm much happier with this; there's presumably a bit of import-time overhead, but it's worth the reduction in complexity. Co-authored-by: nicoo <nicoo@mur.at>
|
bors abort |
|
Canceled. |
|
Oops I had forgotten to push a commit >_>' |
|
bors r=duckinator |
|
Build succeeded: |
Pinning exact versions makes software that share dependencies essentially-impossible to install in the same environment. See #243. We use the “compatible version” operator, `~=`, to specify version constraints, essentially assuming that our dependencies follow SemVer.
244: setup.cfg: Relax version constraints on all dependencies r=duckinator a=nbraud Pinning exact versions makes software that share dependencies essentially-impossible to install in the same environment. See #243 for an example of this kind of issue. We use the “compatible version” operator, `~=`, to specify version constraints, essentially assuming that our dependencies follow SemVer. Co-authored-by: nicoo <nicoo@mur.at>
/versionfile, define__version__based on package metadataThat file doesn't need to be included in the built package, but stays separate for Cirrus to pick up on.
setup.cfgWe aren't using
attr:anymore insetup.cfg, soemanateneeds not be importable at setup-time.I'm much happier with this; there's presumably a bit of import-time overhead, but
it's worth the reduction in complexity.