-
Notifications
You must be signed in to change notification settings - Fork 430
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
Replace bundled conda-index with standalone conda-index package #4690
Conversation
conda_build/build_index.py
Outdated
"msys2-conda-epoch": "m2w64", | ||
} | ||
NAMESPACE_PACKAGE_NAMES = frozenset(NAMESPACES_MAP) | ||
NAMESPACES = frozenset(NAMESPACES_MAP.values()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it wouldn't be surprising if conda.base.constants exists in all conda > 4.7 or the oldest one we can depend on.
conda_build/build_index.py
Outdated
# Copyright (C) 2014 Anaconda, Inc | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
""" | ||
conda-build's use of conda-index, delegated to now-separate conda-index package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied to make keeping track of all the changes easier, and to discourage future conda_build.index
imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, we couldn't continue to have index.py as the place for this code to live? Or asked differently, the get_build_index function, is that something that we have in conda-index? I'm a little worried we're introducing another place where users will end up importing from :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_build_index
is only in conda-build. It is mostly about fetching repodata.json instead of generating repodata.json. It would of course be possible to keep it in conda_build.index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However we might want to raise deprecationwarning when conda_build.index is imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this submodule should exist.
Plus, all of conda.index
should be deprecated with warnings to import from conda-index
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean conda.index
or conda_build.index
Reminder that conda-build's get_build_index
doesn't belong in conda-index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kenodegard @jezdez I moved this module back to conda_build.index
@@ -90,8 +90,8 @@ def execute(args): | |||
|
|||
api.update_index(args.dir, check_md5=args.check_md5, channel_name=args.channel_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to delete this whole file.
conda-index
has a nice click CLI, but doesn't take the same arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be able to use the non-api update_index, the api version is basically "call update_index for every dir in a list"
conda_build/environ.py
Outdated
channel_urls=channel_urls, debug=debug, verbose=verbose, | ||
locking=locking, timeout=timeout) | ||
bldpkgs_dir = list(bldpkgs_dirs)[0] | ||
index, index_ts, _ = build_index.get_build_index(subdir, bldpkgs_dir, output_folder, False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline function courtesy of pycharm refactor feature
conda_build/index.py
Outdated
|
||
return build_index.update_index(dir_path, check_md5, channel_name, patch_generator, threads, | ||
verbose, progress, hotfix_source_repo, subdirs, warn, | ||
current_index_versions, debug, index_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of today an unused copy of the full index implementation remains in this file, for deprecation cycle reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few questions about the deprecation strategy of this code, and generally think we need to use deprecation warnings here and not only shims around the old code paths.
conda_build/build_index.py
Outdated
# Copyright (C) 2014 Anaconda, Inc | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
""" | ||
conda-build's use of conda-index, delegated to now-separate conda-index package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, we couldn't continue to have index.py as the place for this code to live? Or asked differently, the get_build_index function, is that something that we have in conda-index? I'm a little worried we're introducing another place where users will end up importing from :)
I'm still figuring out the best way to do deprecation. The current strategy is to leave the unused methods in, and come back a year later to remove the code. Deprecating the CLI is still an unanswered question. Some of the indexing has changed little enough that the old CLI could be kept in forever, minus the "list of files to re-index" feature. |
@kenodegard I updated, and tried to keep the main branch's version of the test configs. |
I've updated this to remove the new build_index.py and copy it over to index.py instead (since the redundant fuctionality in index is in standalone conda-index). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor edits but is otherwise good to go
@@ -17,7 +17,7 @@ | |||
@pytest.mark.parametrize( | |||
"package,license_id,license_family,license_files", | |||
[ | |||
("r-rmarkdown", "GPL-3", "GPL3", {"GPL-3"}), | |||
# ("r-rmarkdown", "GPL-3", "GPL3", {"GPL-3"}), # fails with connection error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a flaky test, not a failing test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a pointless test IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine but let's have that conversation/effort elsewhere, we want to keep PRs as focused as possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We constantly face a simple choice between a focused PR and a PR with passing tests.
* `conda-build index --file` is no longer supported. | ||
* `conda-build index --hotfix-source-repo` is removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `conda-build index --file` is no longer supported. | |
* `conda-build index --hotfix-source-repo` is removed. | |
* `conda-build index --file` is no longer supported and is pending deprecation. (#4690) | |
* `conda-build index --hotfix-source-repo` is no longer supported and is pending deprecation. (#4690) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to communicate that --file
no longer does anything, and --hotfix-source-repo
produces an "unknown command line argument" error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per CEP9 we shouldn't be removing things outright. We should update the code to allow these arguments but raise deprecation warnings with instructions on what to do instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't CEP9 only apply to conda?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script is probably run in a non-interactive cron job. We could print a warning and fail to do what the user expects, since they are not actually there to observe the deprecation warning. Instead the current code exits.
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My biggest question is how do we know if the new conda-index works like the old conda-index? Is it possible to get tests/test_index.py
to verify the new codes? Or add tests/cli/test_main_index.py
?
conda-index has its own pretty good test suite that is based on the old conda-build suite, in the same way that the rest of the conda-index code is based on its counterpart from conda-build. It has also been in production for defaults & conda-forge for 6+ months. |
This isn't complying with the conda deprecation policy. The index.py module has dramatically changed, and we haven't meticulously gone through to deprecate each individual changed function or provide an alternative; and keeping the unchanged old code around for a deprecation cycle while putting the new code in a separate module also appears to be unacceptable. |
Description
Delegate conda-build's conda-index while keeping code for deprecation cycle reasons.
Could we delete the hotfix-source-repo argument as it has been unused for longer than a deprecation cycle?
Fix #4645
We should probably delete the entire
test_index.py
which is now part of conda-index. Is there any part of index testing that needs to remain here, perhaps the legacy API? Assumingget_build_index
is tested as part of all the conda-build invocations done by us.Checklist - did you ...
news
directory (using the template) for the next release's release notes?