getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.
http://docs.getmoto.org/en/latest/
Apache License 2.0
7.67k stars 2.06k forks source link

What’s the master branch‘s actual current package version? #7908

Closed jenstroeger closed 3 months ago

jenstroeger commented 3 months ago

Looking at the package metadata on the master branch at today’s commit 6282143b19e160369ddfe051cb6a68dc84a2d909 I see https://github.com/getmoto/moto/blob/6282143b19e160369ddfe051cb6a68dc84a2d909/setup.cfg#L1-L3 and also https://github.com/getmoto/moto/blob/6282143b19e160369ddfe051cb6a68dc84a2d909/moto/__init__.py#L3-L4

Release v5.0.11 was released from commit 4867e69d94c8a8b674b43576c790fe57bff9c3e4 which shows https://github.com/getmoto/moto/blob/4867e69d94c8a8b674b43576c790fe57bff9c3e4/setup.cfg#L1-L3 and https://github.com/getmoto/moto/blob/4867e69d94c8a8b674b43576c790fe57bff9c3e4/moto/__init__.py#L3-L4

Can I assume that the current metadata in setup.cfg is incorrect? This matters when I want to install a branch locally (and in editable mode) because pip thinks the package is v4 but it actually seems to be v5:

> python -m pip install --pre --upgrade --upgrade-strategy eager --editable . --editable ../moto/
...

ERROR: Cannot install moto 4.1.0.dev0 (from /path/to/dev/moto) and my-app-package==0.43.3a0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested moto 4.1.0.dev0 (from /path/to/dev/moto)
    my-app-package 0.43.3a0 depends on moto<5.1.0 and >=5.0.0; extra == "test"

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Also, it seems that the artifacts on PyPI and attached to the release (e.g. moto-5.0.11.tar.gz) are built from a different commit or a modified version of the master branch than the actual release commit 4867e69d94c8a8b674b43576c790fe57bff9c3e4, because the artifact attached to the release contains

__title__ = "moto"
__version__ = "5.0.11"

which differs from the release commit.

bblommers commented 3 months ago

Can I assume that the current metadata in setup.cfg is incorrect?

Yes, that assumption is correct. The mismatch of versions was a combination of not committing the right files after updating the version number, and releasing a dirty version of the repository (with uncomitted changes).

PR #7929 fixed it - release 5.0.12 (just out) now contains the proper versions all around, and points to the correct commit.

Thanks for pointing this out @jenstroeger!