Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add numpy 2 hotfix to main #227

Merged
merged 48 commits into from
Aug 13, 2024
Merged
Changes from 6 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7f0f367
add numpy 2 hotfix to main
JamesRobertsonGames Jun 14, 2024
39ec561
ensure the lint passes
JamesRobertsonGames Jun 14, 2024
013d769
Apply suggestions from code review
JamesRobertsonGames Jun 18, 2024
b011dcc
re-add numpy old hotfix
JamesRobertsonGames Jun 18, 2024
e38027f
ensure find packages with lock without ==
JamesRobertsonGames Jun 18, 2024
67417d8
propogate find changes to be made
JamesRobertsonGames Jun 18, 2024
0a93cab
ensure correct application of upper bound hotfix
JamesRobertsonGames Jun 19, 2024
d0d073b
avoid anaconda_depends for repin of numpy
JamesRobertsonGames Jun 19, 2024
d35eab8
add protection list and logic to the n2 hotfix
JamesRobertsonGames Jun 25, 2024
513846a
lint issues
JamesRobertsonGames Jun 25, 2024
9e1ab7b
lint issue
JamesRobertsonGames Jun 25, 2024
b0fd63e
pyyaml added
JamesRobertsonGames Jun 25, 2024
71306c3
pyyaml in testenv
JamesRobertsonGames Jun 25, 2024
ce7e20b
modify yaml and ensure upto date filtering of edge cases
JamesRobertsonGames Jul 16, 2024
0863898
remove need for yaml
JamesRobertsonGames Jul 16, 2024
c979b12
remove pyyaml
JamesRobertsonGames Jul 16, 2024
881cf75
add numpy 2 hotfix rework
JamesRobertsonGames Jul 25, 2024
18e3c4d
formatting changes
JamesRobertsonGames Jul 25, 2024
e3cb04b
main trimmed whitespace
JamesRobertsonGames Jul 25, 2024
86c54a1
repair lint issues
JamesRobertsonGames Jul 25, 2024
0027dab
remove all the lint errors from flake
JamesRobertsonGames Jul 25, 2024
571832b
revert test-hotfix
JamesRobertsonGames Jul 25, 2024
34f2d32
py-rattler adding
JamesRobertsonGames Jul 25, 2024
fec2680
add to readme the new processes
JamesRobertsonGames Jul 25, 2024
ed2659a
remove dep none remover
JamesRobertsonGames Jul 25, 2024
4d654e5
remove yaml
JamesRobertsonGames Jul 25, 2024
c26a1fd
upload proposed changes
JamesRobertsonGames Jul 25, 2024
71e30cd
Apply suggestions from code review
JamesRobertsonGames Jul 26, 2024
d75edb5
Update numpy2.py
JamesRobertsonGames Jul 26, 2024
411223c
change code for clearer changes for numpy 2
JamesRobertsonGames Jul 26, 2024
6716a8f
remove rattler goodness
JamesRobertsonGames Jul 26, 2024
8dd4c11
change to n2
JamesRobertsonGames Jul 26, 2024
c896b1b
flake8
JamesRobertsonGames Jul 26, 2024
d2ab4c9
remove logging for items not being updated
JamesRobertsonGames Jul 26, 2024
2d59ddb
regenerate n2 patch
JamesRobertsonGames Jul 26, 2024
7f237ee
Merge branch 'master' into numpy2-hotfix
ryanskeith Jul 27, 2024
c1b7795
make changes suggested in previous review
JamesRobertsonGames Aug 1, 2024
7639c1a
linting errors fixed
JamesRobertsonGames Aug 1, 2024
c09fa2f
delete numpy2 config and lint modifications
JamesRobertsonGames Aug 1, 2024
4326c27
speed up patching process with better data handling
JamesRobertsonGames Aug 1, 2024
1eb8cd5
README updated with changes
JamesRobertsonGames Aug 1, 2024
e5bb64f
make changes for legibility to per review
JamesRobertsonGames Aug 8, 2024
3b6625c
linting correctors
JamesRobertsonGames Aug 8, 2024
c54945f
remove correction code
JamesRobertsonGames Aug 13, 2024
36222d0
revert to force git to pick up the change
JamesRobertsonGames Aug 13, 2024
4d8e248
revert depends and contrains
JamesRobertsonGames Aug 13, 2024
b6595af
ensure return case is not needed
JamesRobertsonGames Aug 13, 2024
4d468b1
remove protect dict to await issues
JamesRobertsonGames Aug 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,38 @@
]


def _update_numpy_base_dependencies(fn, record, instructions):
depends = record.get("depends", [])
updated = False
for i, dep in enumerate(depends):
if dep.split()[0] == "numpy-base" and '==' not in dep and "1." not in dep and '<' not in dep:
depends[i] = dep + ",<2.0a0"
updated = True
else:
depends[i] = "numpy-base <2.0a0"
updated = True
JamesRobertsonGames marked this conversation as resolved.
Show resolved Hide resolved
if updated:
instructions["packages"][fn]['depends'] = depends
return updated


def _update_numpy_dependencies(fn, record, instructions):
depends = record.get("depends", [])
updated = False
for i, dep in enumerate(depends):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i, dep in enumerate(depends):
replace_dep(depends, change["original"], change["updated"])

replace_dep is the standard usage for replacing deps in main.py.

if dep.split()[0] == "numpy":
# If there's no upper bound and the dependency isn't pinned to a specific version
if '==' not in dep and "1." not in dep and '<' not in dep:
depends[i] = dep + ",<2.0a0"
updated = True
elif dep == "numpy":
depends[i] = "numpy <2.0a0"
updated = True
if updated:
instructions["packages"][fn]['depends'] = depends
return updated


def _replace_vc_features_with_vc_pkg_deps(name, record, depends):
python_vc_deps = {
"2.6": "vc 9.*",
Expand Down Expand Up @@ -671,6 +703,18 @@ def patch_record_in_place(fn, record, subdir):
depends[i] = depends[i].replace(">=1.21.5,", ">=1.21.2,")
break

# to update dependencies for preperation for numpy 2.0.0
numpy_instructions = {
"patch_instructions_version": 1,
"packages": defaultdict(dict),
"revoke": [],
"remove": [],
}
if name == "numpy":
_update_numpy_dependencies(fn, record, numpy_instructions)
elif name == "numpy-base":
_update_numpy_base_dependencies(fn, record, numpy_instructions)

###########
# pytorch #
###########
Expand Down
Loading