Commit 95f7bf6
authored
fix: Guard against removing package while uploading to it (#64)
* fix: Guard against removing package while uploading to it
* On Anaconda Cloud as of 2024-01-04, if a wheel is being uploaded to a
package, but the package only has one wheel in it and is of the same
name as the uploaded wheel, Anaconda Cloud will overwrite the file by
_removing_ the file from the package index. However, when this happens
it removes the entire package, and then the wheel that is in the
process of being uploaded has no destination and the upload fails.
To guard against this, ensure for each package that has a wheel being
uploaded if:
- there is only one release for the package
- and only 1 file for that release
- and the upload target wheel has the same name as the file
- that the file (and so the package) is removed in advance of the
upload.
* To make filtering names and versions from wheels easier, add a
get_wheel_name_version function that uses as regex to lazily capture
the package name as well as the version and then return these.
- Examples of this working:
* "matplotlib-3.9.0.dev0-pp39-pypy39_pp73-win_amd64.whl"
matplotlib 3.9.0.dev0
* "scikit_learn-1.5.dev0-cp39-cp39-win_amd64.whl"
scikit_learn 1.5.dev0
* "scipy-openblas64-0.3.26.186-py3-none-macosx_10_9_x86_64.whl"
scipy-openblas64 0.3.26.186
* "awkward_cpp-29-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
awkward_cpp 29
* As Anaconda Cloud normalizes package names, also distinguish between
basename and package name to try to make things easier to keep track
of when normalizing.
* Example:
- basename: test_package-0.0.1-py3-none-any.whl
- basename prefix: test_package
- package_name: test-package
* MNT: Add curl and jq to environment
* As curl and jq are now used in cmd.sh, they need to also be added to
the conda environment.yml.
* The lower bounds are chosen as the latest values, but are not
motivated by known problems.
* Rebuild the lock file.
* CI: Add a test to revmove a package
* Add a test that triggers the conditions for removal of a package from
Anaconda Cloud in advance of its upload to avoid an error.1 parent 66bc1b6 commit 95f7bf6
4 files changed
Lines changed: 812 additions & 595 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
70 | 134 | | |
71 | 135 | | |
72 | 136 | | |
| |||
0 commit comments