torchbox/wagtail-markdown

It appears that version 0.11.0 may have overwritten version 0.10.0 in the package repo

davidbrewer opened this issue · 3 comments

I recently (today) attempted to deploy a project based on wagtail 3.0.3 and wagtail-markdown 0.10.0 and got some dependency errors when pip tried to install our dependencies. The deploy process says there is a conflict because wagtail-markdown 0.10.0 depends on Wagtail>=4.1 — but until recently this was working fine with exactly the same requirements.txt.

I noticed that wagtail-markdown a couple of days ago published a new version 0.11.0 that DOES require Wagtail 4.1 and up. Upon further investigation, I think that perhaps when the package was published, the contents of the new 0.11.0 version of the package somehow overwrote the previous 0.10.0 version in the pip repository.

I did the following to confirm this:

# start in an empty directory

# Download version 0.10.0 from pip and extract it
mkdir 0.10.0
cd 0.10.0
pip download wagtail-markdown==0.10.0 --no-deps
mv wagtail_markdown-0.10.0-py3-none-any.whl wagtail_markdown-0.10.0-py3-none-any.zip
unzip wagtail_markdown-0.10.0-py3-none-any.zip

# Download version 0.11.0 from pip and extract it
cd ..
mkdir 0.11.0
cd 0.11.0
pip download wagtail-markdown==0.11.0 --no-deps
mv wagtail_markdown-0.11.0-py3-none-any.whl wagtail_markdown-0.11.0-py3-none-any.zip
unzip wagtail_markdown-0.11.0-py3-none-any.zip

# Now go up to the top and do a diff
cd ..
git diff 0.10.0 0.11.0

# You'll see the only significant difference is the version number in wagtailmarkdown/__init__.py

@zerolab Hello! Tagging you on this one since from the changelog it looks like you might be the packager. I'm no expert in Python packaging but let me know if there's any additional information you need (or if I totally misunderstood the problem, wouldn't be the first time...)

@davidbrewer try again?
While changing packaging I've accidentally built and tried to push v0.11 withouth changing the version in https://github.com/torchbox/wagtail-markdown/blob/main/src/wagtailmarkdown/__init__.py

This pushed a py3 wheel to https://pypi.org/manage/project/wagtail-markdown/release/0.10.0/ so we had wagtail_markdown-0.10.0-py2.py3-none-any.whl and wagtail_markdown-0.10.0-py3-none-any.whl and pip picked up the py3 only.

CI action log
Built wheel: dist/wagtail_markdown-0.10.0-py3-none-any.whl  I-flit_core.wheel
Using repository at https://upload.pypi.org/legacy/      I-flit.upload
Uploading dist/wagtail_markdown-0.10.0-py3-none-any.whl...  I-flit.upload
Package is at https://pypi.org/project/wagtail-markdown/ I-flit.upload
Using repository at https://upload.pypi.org/legacy/      I-flit.upload
Uploading dist/wagtail-markdown-0.10.0.tar.gz...         I-flit.upload
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.16/x64/bin/flit", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/flit/__init__.py", line 188, in main
    main(args.ini_file, repository, args.pypirc, formats=set(args.format or []),
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/flit/upload.py", line 276, in main
    do_upload(built.sdist.file, built.sdist.builder.metadata, pypirc_path, repo_name)
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/flit/upload.py", line 252, in do_upload
    upload_file(file, metadata, repo)
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/flit/upload.py", line 245, in upload_file
    resp.raise_for_status()
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: File already exists. See https://pypi.org/help/#file-name-reuse for more information. for url: https://upload.pypi.org/legacy/

Removed the extra wheel file. Sorry about that!

Will add extra checks to ensure the build version and the release version match

@zerolab Worked perfectly this time! Thanks for the fast response and turnaround, I really appreciate it.