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

Replace bundled conda-index with standalone conda-index package #4690

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3d54dfa
depend on conda-index
dholth Jan 4, 2023
653cb83
delegate indexing to conda-index package
dholth Jan 4, 2023
5ef0f1f
remove obsolute index_file test
dholth Jan 4, 2023
71eab18
add news
dholth Jan 4, 2023
0596350
add conda-index to install_conda_build_test_deps
dholth Jan 4, 2023
272caf9
Merge remote-tracking branch 'origin/main' into conda-index
dholth Jan 6, 2023
05d7f05
format conda_build/index.py for pre-commit
dholth Jan 6, 2023
dd76ea6
remove unnecessary import fallback
dholth Jan 6, 2023
8eeaec6
linter changes
dholth Jan 6, 2023
f9fffbd
update windows ci deps
dholth Jan 6, 2023
c706da4
python-libarchive-c is required after all, for utils
dholth Jan 6, 2023
c1e57ef
remove test_index (exists in standalone conda-index tests)
dholth Jan 6, 2023
e59b860
deal with update_index(subdir) instead of update_index(dir)
dholth Jan 6, 2023
ad6c0f7
use single thread when indexing for build
dholth Jan 7, 2023
d9cc516
Merge remote-tracking branch 'origin/main' into conda-index
dholth Jan 20, 2023
560ad71
remove build_index module
dholth Feb 3, 2023
1e8f1d9
Merge remote-tracking branch 'origin/main' into conda-index
dholth Feb 3, 2023
74b2d7c
format environ.py
dholth Feb 3, 2023
f047145
add conda-index dependency to recipe
dholth Feb 3, 2023
e27c8fb
add conda-index to requirements.txt
dholth Feb 3, 2023
1eb6752
restore subdirs fix
dholth Feb 3, 2023
2e7c40c
Merge remote-tracking branch 'origin/main' into conda-index
dholth Feb 4, 2023
cc63b28
ruamelize
dholth Feb 4, 2023
fe3647e
adjust distutils patch deps
dholth Feb 4, 2023
ad31a23
lint fixes
dholth Feb 4, 2023
8c0117b
keyword arguments
dholth Feb 4, 2023
55e5ba2
indent
dholth Feb 4, 2023
51ba55a
Merge remote-tracking branch 'origin/main' into conda-index
dholth Feb 22, 2023
a6cbec4
remove package from test
dholth Feb 22, 2023
f1d52e2
Apply suggestions from code review
dholth Feb 24, 2023
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
34 changes: 26 additions & 8 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2376,14 +2376,30 @@ def build(m, stats, post=None, need_source_download=True, need_reparse_in_env=Fa
subdir = ('noarch' if (m.noarch or m.noarch_python)
else m.config.host_subdir)
if m.is_cross:
get_build_index(subdir=subdir, bldpkgs_dir=m.config.bldpkgs_dir,
output_folder=m.config.output_folder, channel_urls=m.config.channel_urls,
debug=m.config.debug, verbose=m.config.verbose, locking=m.config.locking,
timeout=m.config.timeout, clear_cache=True)
get_build_index(subdir=subdir, bldpkgs_dir=m.config.bldpkgs_dir,
output_folder=m.config.output_folder, channel_urls=m.config.channel_urls,
debug=m.config.debug, verbose=m.config.verbose, locking=m.config.locking,
timeout=m.config.timeout, clear_cache=True)
get_build_index(
subdir,
m.config.bldpkgs_dir,
m.config.output_folder,
channel_urls=m.config.channel_urls,
debug=m.config.debug,
verbose=m.config.verbose,
locking=m.config.locking,
timeout=m.config.timeout,
clear_cache=True,
omit_defaults=False,
)
get_build_index(
subdir,
m.config.bldpkgs_dir,
m.config.output_folder,
channel_urls=m.config.channel_urls,
debug=m.config.debug,
verbose=m.config.verbose,
locking=m.config.locking,
timeout=m.config.timeout,
clear_cache=True,
omit_defaults=False,
)
else:
if not provision_only:
print("STOPPING BUILD BEFORE POST:", m.dist())
Expand Down Expand Up @@ -3382,6 +3398,8 @@ def clean_build(config, folders=None):


def is_package_built(metadata, env, include_local=True):
# bldpkgs_dirs is typically {'$ENVIRONMENT/conda-bld/noarch', '$ENVIRONMENT/conda-bld/osx-arm64'}
# could pop subdirs (last path element) and call update_index() once
for d in metadata.config.bldpkgs_dirs:
if not os.path.isdir(d):
os.makedirs(d)
Expand Down
12 changes: 6 additions & 6 deletions conda_build/cli/main_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

from conda_build.conda_interface import ArgumentParser

from conda_build import api
from conda_build.index import MAX_THREADS_DEFAULT
from conda_build.utils import DEFAULT_SUBDIRS
from conda_index import api
from conda_index.index import MAX_THREADS_DEFAULT
from conda_index.utils import DEFAULT_SUBDIRS

logging.basicConfig(level=logging.INFO)

Expand Down Expand Up @@ -77,7 +77,7 @@ def parse_args(args):
)
p.add_argument(
"-f", "--file",
help="A file that contains a new line separated list of packages to add to repodata.",
help="A file that contains a new line separated list of packages to add to repodata. Deprecated, will be removed in a future version of conda build.",
action="store"
)

Expand All @@ -90,8 +90,8 @@ def execute(args):

api.update_index(args.dir, check_md5=args.check_md5, channel_name=args.channel_name,
Copy link
Contributor Author

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.

Copy link
Contributor Author

@dholth dholth Jan 6, 2023

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"

threads=args.threads, subdir=args.subdir, patch_generator=args.patch_generator,
verbose=args.verbose, progress=args.progress, hotfix_source_repo=args.hotfix_source_repo,
current_index_versions=args.current_index_versions_file, index_file=args.file)
verbose=args.verbose, progress=args.progress,
current_index_versions=args.current_index_versions_file)


def main():
Expand Down
29 changes: 9 additions & 20 deletions conda_build/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,22 @@
from glob import glob
from os.path import join, normpath

from .conda_interface import (
CondaError,
LinkError,
LockError,
NoPackagesFoundError,
PaddingError,
UnsatisfiableError,
)
from .conda_interface import (
display_actions,
execute_actions,
execute_plan,
install_actions,
)
from .conda_interface import package_cache, TemporaryDirectory
from .conda_interface import pkgs_dirs, root_dir, create_default_packages
from .conda_interface import reset_context
from .conda_interface import get_version_from_git_tag

from conda_build import utils
from conda_build.exceptions import BuildLockError, DependencyNeedsBuildingError
from conda_build.features import feature_list
from conda_build.index import get_build_index
from conda_build.os_utils import external
from conda_build.utils import ensure_list, prepend_bin_path, env_var
from conda_build.utils import ensure_list, env_var, prepend_bin_path
from conda_build.variants import get_default_variant

from .conda_interface import (CondaError, LinkError, LockError,
NoPackagesFoundError, PaddingError,
TemporaryDirectory, UnsatisfiableError,
create_default_packages, display_actions,
execute_actions, execute_plan,
get_version_from_git_tag, install_actions,
package_cache, pkgs_dirs, reset_context,
root_dir)

# these are things that we provide env vars for more explicitly. This list disables the
# pass-through of variant values to env vars for these keys.
Expand Down
Loading