diff --git a/conda_build/cli/main_build.py b/conda_build/cli/main_build.py index 221299b485..03dd881ca5 100644 --- a/conda_build/cli/main_build.py +++ b/conda_build/cli/main_build.py @@ -24,7 +24,6 @@ get_or_merge_config, zstd_compression_level_default, ) -from ..deprecations import deprecated from ..utils import LoggingContext from .actions import KeyValueAction, PackageTypeNormalize from .main_render import get_render_parser @@ -488,19 +487,14 @@ def parse_args(args: Sequence[str] | None) -> tuple[ArgumentParser, Namespace]: "Do not display value of environment variables specified in build.script_env." ), ) - # TODO: Remove in 25.1 - default_pkg_format = context.conda_build.get("pkg_format") - if default_pkg_format is None: - warn_about_default_pkg_format = True - default_pkg_format = conda_pkg_format_default - else: - warn_about_default_pkg_format = False parser.add_argument( "--package-format", dest="conda_pkg_format", choices=CondaPkgFormat.acceptable(), action=PackageTypeNormalize, - default=CondaPkgFormat.normalize(default_pkg_format), + default=CondaPkgFormat.normalize( + context.conda_build.get("pkg_format", conda_pkg_format_default) + ), help=( "Choose which package type(s) are outputted. (Accepted inputs .tar.bz2 or 1, .conda or 2)" ), @@ -510,26 +504,6 @@ def parse_args(args: Sequence[str] | None) -> tuple[ArgumentParser, Namespace]: parsed = parser.parse_args(args) check_recipe(parsed.recipe) - # TODO: Remove in 25.1 - if ( - all(not arg.startswith("--package-format") for arg in (args or [])) - and warn_about_default_pkg_format - and "purge" not in parsed.recipe - and "purge-all" not in parsed.recipe - ): - deprecated.topic( - "24.11", - "25.1", - topic="The default `pkg_format` of '.tar.bz2'", - addendum=( - "\n\n" - "The new default `pkg_format` value will be '.conda'. " - "If you want to keep using `.tar.bz2`, consider:\n" - "- Setting `conda_build.pkg_format: 'tar.bz2' in your condarc file.\n" - "- Using `--pkg-format=tar.bz2` in the CLI.\n" - ), - deprecation_type=FutureWarning, - ) return parser, parsed diff --git a/conda_build/config.py b/conda_build/config.py index 791005c08a..5ec0e881c7 100644 --- a/conda_build/config.py +++ b/conda_build/config.py @@ -101,7 +101,7 @@ def ext(self): no_rewrite_stdout_env_default = "false" ignore_verify_codes_default = [] exit_on_verify_error_default = False -conda_pkg_format_default = CondaPkgFormat.V1 +conda_pkg_format_default = CondaPkgFormat.V2 zstd_compression_level_default = 19 diff --git a/conda_build/metadata.py b/conda_build/metadata.py index aac77da298..f10b5896a0 100644 --- a/conda_build/metadata.py +++ b/conda_build/metadata.py @@ -1767,7 +1767,12 @@ def dist(self): return f"{self.name()}-{self.version()}-{self.build_id()}" def pkg_fn(self): - return f"{self.dist()}.tar.bz2" + ext = ( + CondaPkgFormat.V2.ext + if self.config.conda_pkg_format == CondaPkgFormat.V2 + else CondaPkgFormat.V1.ext + ) + return f"{self.dist()}{ext}" def is_app(self): return bool(self.get_value("app/entry")) diff --git a/conda_build/utils.py b/conda_build/utils.py index 6461e1c8b0..826090e863 100644 --- a/conda_build/utils.py +++ b/conda_build/utils.py @@ -1141,10 +1141,14 @@ def package_has_file(package_path, file_path, refresh_mode="modified"): conda_package_handling.api.extract( package_path, dest_dir=td, components="info" ) - else: + elif package_path.endswith(".tar.bz2"): conda_package_handling.api.extract( package_path, dest_dir=td, components=file_path ) + else: + conda_package_handling.api.extract( + package_path, dest_dir=td, components="pkg" + ) resolved_file_path = os.path.join(td, file_path) if os.path.exists(resolved_file_path): # TODO :: Remove this text-mode load. Files are binary. diff --git a/docs/source/concepts/generating-index.rst b/docs/source/concepts/generating-index.rst index b512d9c7e5..4fbefd9ec7 100644 --- a/docs/source/concepts/generating-index.rst +++ b/docs/source/concepts/generating-index.rst @@ -97,7 +97,26 @@ Parts of a channel "version": "0.1.0" }, ... + }, + "packages.conda": { + "super-fun-package-0.2.0-py310_0.conda": { + "build": "py37_0", + "build_number": 0, + "depends": [ + "some-depends" + ], + "license": "BSD", + "md5": "a75683f8d9f5b58c19a8ec5d0b7f796e", + "name": "super-fun-package", + "sha256": "e39029d601b9f493ea05c37a2630a9fe5810f1fe3c3f4250e51886838e8e0287", + "size": 4125, + "subdir": "win-64", + "timestamp": 1530731987654, + "version": "0.2.0" + }, + ... } + } How an index is generated ------------------------- @@ -218,7 +237,7 @@ already extracted can save a lot of time in fully re-creating the index, should that be necessary. An aside: one design goal of the ``.conda`` package format was to make indexing as -fast as possible. To achieve this, the .conda format separates metadata from the +fast as possible. To achieve this, the ``.conda`` format separates metadata from the actual package contents. Where the old ``.tar.bz2`` container required extracting the entire package to obtain the metadata, the new package format allows extraction of metadata without touching the package contents. This allows diff --git a/docs/source/concepts/package-naming-conv.rst b/docs/source/concepts/package-naming-conv.rst index 5d3f20f538..12ddcfc6e5 100644 --- a/docs/source/concepts/package-naming-conv.rst +++ b/docs/source/concepts/package-naming-conv.rst @@ -43,8 +43,8 @@ The following figure compares a canonical name to a filename: | Conda supports both ``.conda`` and ``.tar.bz2`` package extensions. The ``.conda`` -format is generally smaller and more efficient than ``.tar.bz2`` packages. -Read our `blog post`_ about it to learn more. +format (default since 25.1) is generally smaller and more efficient than ``.tar.bz2`` +packages. Read our `blog post`_ about it to learn more. The build string is created as the package is built. Things that contribute to it are the variants specified either by the command diff --git a/docs/source/resources/package-spec.rst b/docs/source/resources/package-spec.rst index 90c09289aa..57326096d1 100644 --- a/docs/source/resources/package-spec.rst +++ b/docs/source/resources/package-spec.rst @@ -17,9 +17,9 @@ There are currently two formats of archives that are supported: - **Description** * - .tar.bz2 - - The original format of conda packages. Is the default output of conda-build. + - The original format of conda packages. * - .conda - - 2nd Gen. This is a more compact and thus faster. Can be outputed from conda-build by setting output in ``.condarc`` file. + - 2nd Gen. This is a more compact and thus faster. Default since 25.1. The formats are identical across platforms and operating systems. During the install process, all files are extracted into the diff --git a/news/5527-dot-conda-default b/news/5527-dot-conda-default new file mode 100644 index 0000000000..30e9c229ba --- /dev/null +++ b/news/5527-dot-conda-default @@ -0,0 +1,19 @@ +### Enhancements + +* Make `.conda` the new default package format. `.tar.bz2` files can still be generated with `--package-format=1` and/or `conda_build.pkg_format: 1` in your `.condarc` file. (#5183 via #5527) + +### Bug fixes + +* + +### Deprecations + +* + +### Docs + +* + +### Other + +* diff --git a/tests/cli/test_main_build.py b/tests/cli/test_main_build.py index 79525f5547..86bc86f683 100644 --- a/tests/cli/test_main_build.py +++ b/tests/cli/test_main_build.py @@ -29,9 +29,6 @@ from conda_build.metadata import MetaData -# FUTURE: Remove after 25.1 -DEFAULT_PACKAGE_FORMAT_FLAG = "--package-format=1" - @pytest.mark.sanity def test_build_empty_sections(conda_build_test_recipe_envvar: str): @@ -40,7 +37,6 @@ def test_build_empty_sections(conda_build_test_recipe_envvar: str): os.path.join(metadata_dir, "empty_sections"), "--no-activate", "--no-anaconda-upload", - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) @@ -56,7 +52,6 @@ def test_build_add_channel(): "conda_build_test", "--no-activate", "--no-anaconda-upload", - DEFAULT_PACKAGE_FORMAT_FLAG, os.path.join(metadata_dir, "_recipe_requiring_external_channel"), ] main_build.execute(args) @@ -69,7 +64,6 @@ def test_build_without_channel_fails(testing_workdir): "--no-anaconda-upload", "--no-activate", os.path.join(metadata_dir, "_recipe_requiring_external_channel"), - DEFAULT_PACKAGE_FORMAT_FLAG, ] with pytest.raises(DependencyNeedsBuildingError): main_build.execute(args) @@ -87,7 +81,6 @@ def test_no_filename_hash(testing_workdir, testing_metadata, capfd): "--no-activate", testing_workdir, "--old-build-string", - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) output, error = capfd.readouterr() @@ -107,12 +100,12 @@ def test_build_output_build_path( api.output_yaml(testing_metadata, "meta.yaml") testing_config.verbose = False testing_config.debug = False - args = ["--output", testing_workdir, DEFAULT_PACKAGE_FORMAT_FLAG] + args = ["--output", testing_workdir] main_build.execute(args) test_path = os.path.join( testing_config.croot, testing_config.host_subdir, - "test_build_output_build_path-1.0-1.tar.bz2", + "test_build_output_build_path-1.0-1.conda", ) output, error = capfd.readouterr() assert test_path == output.rstrip(), error @@ -125,7 +118,7 @@ def test_build_output_build_path_multiple_recipes( api.output_yaml(testing_metadata, "meta.yaml") testing_config.verbose = False skip_recipe = os.path.join(metadata_dir, "build_skip") - args = ["--output", testing_workdir, skip_recipe, DEFAULT_PACKAGE_FORMAT_FLAG] + args = ["--output", testing_workdir, skip_recipe] main_build.execute(args) @@ -133,7 +126,7 @@ def test_build_output_build_path_multiple_recipes( testing_config.croot, testing_config.host_subdir, pkg ) test_paths = [ - test_path("test_build_output_build_path_multiple_recipes-1.0-1.tar.bz2"), + test_path("test_build_output_build_path_multiple_recipes-1.0-1.conda"), ] output, error = capfd.readouterr() @@ -149,7 +142,7 @@ def test_slash_in_recipe_arg_keeps_build_id( "--croot", testing_config.croot, "--no-anaconda-upload", - DEFAULT_PACKAGE_FORMAT_FLAG, + "--package-format=1", ] main_build.execute(args) @@ -169,7 +162,7 @@ def test_slash_in_recipe_arg_keeps_build_id( @pytest.mark.skipif(on_win, reason="prefix is always short on win.") def test_build_long_test_prefix_default_enabled(mocker, testing_workdir): recipe_path = os.path.join(metadata_dir, "_test_long_test_prefix") - args = [recipe_path, "--no-anaconda-upload", DEFAULT_PACKAGE_FORMAT_FLAG] + args = [recipe_path, "--no-anaconda-upload"] main_build.execute(args) args.append("--no-long-test-prefix") @@ -185,7 +178,7 @@ def test_build_no_build_id(testing_workdir: str, testing_config: Config): testing_config.croot, "--no-activate", "--no-anaconda-upload", - DEFAULT_PACKAGE_FORMAT_FLAG, + "--package-format=1", ] main_build.execute(args) @@ -214,7 +207,7 @@ def test_build_multiple_recipes(testing_metadata, testing_workdir, testing_confi api.output_yaml(testing_metadata, "recipe2/meta.yaml") with open("recipe2/run_test.py", "w") as f: f.write("import os; assert 'package2' in os.getenv('PREFIX')") - args = ["--no-anaconda-upload", "recipe1", "recipe2", DEFAULT_PACKAGE_FORMAT_FLAG] + args = ["--no-anaconda-upload", "recipe1", "recipe2"] main_build.execute(args) @@ -233,7 +226,6 @@ def test_build_output_folder(testing_workdir: str, testing_metadata: MetaData): "--no-anaconda-upload", "--output-folder", str(out), - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) @@ -251,7 +243,6 @@ def test_build_source(testing_workdir: str): testing_workdir, "--no-activate", "--no-anaconda-upload", - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) assert Path(testing_workdir, "work", "setup.py").is_file() @@ -320,14 +311,12 @@ def test_no_force_upload( ) # check for normal upload - main_build.execute( - ["--no-force-upload", testing_workdir, DEFAULT_PACKAGE_FORMAT_FLAG] - ) + main_build.execute(["--no-force-upload", testing_workdir]) call.assert_called_once_with([anaconda, "upload", *pkg]) call.reset_mock() # check for force upload - main_build.execute([testing_workdir, DEFAULT_PACKAGE_FORMAT_FLAG]) + main_build.execute([testing_workdir]) call.assert_called_once_with([anaconda, "upload", "--force", *pkg]) @@ -348,7 +337,7 @@ def test_build_skip_existing( ): # build the recipe first empty_sections = os.path.join(metadata_dir, "empty_sections") - args = ["--no-anaconda-upload", empty_sections, DEFAULT_PACKAGE_FORMAT_FLAG] + args = ["--no-anaconda-upload", empty_sections] main_build.execute(args) args.insert(0, "--skip-existing") import conda_build.source @@ -372,7 +361,6 @@ def test_build_skip_existing_croot( "--croot", testing_workdir, empty_sections, - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) args.insert(0, "--skip-existing") @@ -386,7 +374,7 @@ def test_package_test(testing_workdir, testing_metadata): """Test calling conda build -t - rather than """ api.output_yaml(testing_metadata, "recipe/meta.yaml") output = api.build(testing_workdir, config=testing_metadata.config, notest=True)[0] - args = ["-t", output, DEFAULT_PACKAGE_FORMAT_FLAG] + args = ["-t", output] main_build.execute(args) @@ -397,7 +385,6 @@ def test_activate_scripts_not_included(testing_workdir): "--croot", testing_workdir, recipe, - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) out = api.get_output_file_paths(recipe, croot=testing_workdir)[0] @@ -430,13 +417,12 @@ def test_relative_path_croot( "--no-anaconda-upload", f"--croot={croot}", str(empty_sections), - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) - assert len(list(croot.glob("**/*.tar.bz2"))) == 1 + assert len(list(croot.glob("**/*.conda"))) == 1 assert ( - croot / testing_config.subdir / "empty_with_build_script-0.0-0.tar.bz2" + croot / testing_config.subdir / "empty_with_build_script-0.0-0.conda" ).is_file() @@ -444,7 +430,7 @@ def test_relative_path_test_artifact( conda_build_test_recipe_envvar: str, testing_config: Config ): # this test builds a package into (cwd)/relative/path and then calls: - # conda-build --test ./relative/path/{platform}/{artifact}.tar.bz2 + # conda-build --test ./relative/path/{platform}/{artifact}.conda empty_sections = Path(metadata_dir, "empty_with_build_script") croot_rel = Path(".", "relative", "path") croot_abs = croot_rel.resolve() @@ -455,11 +441,10 @@ def test_relative_path_test_artifact( "--no-test", f"--croot={croot_abs}", str(empty_sections), - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) - assert len(list(croot_abs.glob("**/*.tar.bz2"))) == 1 + assert len(list(croot_abs.glob("**/*.conda"))) == 1 # run the test stage with relative path args = [ @@ -468,9 +453,8 @@ def test_relative_path_test_artifact( os.path.join( croot_rel, testing_config.subdir, - "empty_with_build_script-0.0-0.tar.bz2", + "empty_with_build_script-0.0-0.conda", ), - DEFAULT_PACKAGE_FORMAT_FLAG, ] main_build.execute(args) @@ -481,13 +465,13 @@ def test_test_extra_dep(testing_metadata): output = api.build(testing_metadata, notest=True, anaconda_upload=False)[0] # tests version constraints. CLI would quote this - "click <6.7" - args = [output, "-t", "--extra-deps", "imagesize <1.0", DEFAULT_PACKAGE_FORMAT_FLAG] + args = [output, "-t", "--extra-deps", "imagesize <1.0"] # extra_deps will add it in main_build.execute(args) # missing click dep will fail tests with pytest.raises(CondaBuildUserError): - args = [output, "-t", DEFAULT_PACKAGE_FORMAT_FLAG] + args = [output, "-t"] # extra_deps will add it in main_build.execute(args) @@ -497,7 +481,7 @@ def test_test_extra_dep(testing_metadata): [([], True), (["--long-test-prefix"], True), (["--no-long-test-prefix"], False)], ) def test_long_test_prefix(additional_args, is_long_test_prefix): - args = ["non_existing_recipe", DEFAULT_PACKAGE_FORMAT_FLAG] + additional_args + args = ["non_existing_recipe", *additional_args] parser, args = main_build.parse_args(args) config = Config(**args.__dict__) assert config.long_test_prefix is is_long_test_prefix @@ -526,7 +510,7 @@ def test_zstd_compression_level( ) request.addfinalizer(_reset_config) _reset_config([os.path.join(testing_workdir, ".condarc")]) - args = ["non_existing_recipe", DEFAULT_PACKAGE_FORMAT_FLAG] + args = ["non_existing_recipe"] if zstd_level_cli: args.append(f"--zstd-compression-level={zstd_level_cli}") parser, args = main_build.parse_args(args) @@ -544,14 +528,14 @@ def test_user_warning(tmpdir, recwarn): recipe = dir_recipe_path.join("meta.yaml") recipe.write("") - main_build.parse_args([str(recipe), DEFAULT_PACKAGE_FORMAT_FLAG]) + main_build.parse_args([str(recipe)]) assert ( f"RECIPE_PATH received is a file ({recipe}).\n" "It should be a path to a folder.\n" "Forcing conda-build to use the recipe file." ) == str(recwarn.pop(UserWarning).message) - main_build.parse_args([str(dir_recipe_path), DEFAULT_PACKAGE_FORMAT_FLAG]) + main_build.parse_args([str(dir_recipe_path)]) assert not recwarn.list @@ -562,6 +546,5 @@ def test_build_with_empty_channel_fails(empty_channel: Path) -> None: "--override-channels", f"--channel={empty_channel}", os.path.join(metadata_dir, "_recipe_requiring_external_channel"), - DEFAULT_PACKAGE_FORMAT_FLAG, ] ) diff --git a/tests/cli/test_main_inspect.py b/tests/cli/test_main_inspect.py index 83859bf441..b60c7c9ec9 100644 --- a/tests/cli/test_main_inspect.py +++ b/tests/cli/test_main_inspect.py @@ -52,7 +52,9 @@ def test_inspect_prefix_length(testing_workdir, capfd): # build our own known-length package here test_base = os.path.expanduser("~/cbtmp") - config = api.Config(croot=test_base, anaconda_upload=False, verbose=True) + config = api.Config( + croot=test_base, anaconda_upload=False, verbose=True, conda_pkg_format=1 + ) recipe_path = os.path.join(metadata_dir, "has_prefix_files") config.prefix_length = 80 outputs = api.build(recipe_path, config=config, notest=True) diff --git a/tests/cli/test_main_metapackage.py b/tests/cli/test_main_metapackage.py index 44ec145264..02db077ffd 100644 --- a/tests/cli/test_main_metapackage.py +++ b/tests/cli/test_main_metapackage.py @@ -16,7 +16,7 @@ def test_metapackage(testing_config, testing_workdir): os.path.join( testing_config.croot, testing_config.host_subdir, - "metapackage_test-1.0-0.tar.bz2", + "metapackage_test-1.0-0.conda", ) )[0] assert os.path.isfile(test_path) @@ -38,7 +38,7 @@ def test_metapackage_build_number(testing_config, testing_workdir): os.path.join( testing_config.croot, testing_config.host_subdir, - "metapackage_test_build_number-1.0-1.tar.bz2", + "metapackage_test_build_number-1.0-1.conda", ) )[0] assert os.path.isfile(test_path) @@ -60,7 +60,7 @@ def test_metapackage_build_string(testing_config, testing_workdir): os.path.join( testing_config.croot, testing_config.host_subdir, - "metapackage_test_build_string-1.0-frank*.tar.bz2", + "metapackage_test_build_string-1.0-frank*.conda", ) )[0] assert os.path.isfile(test_path) @@ -86,7 +86,7 @@ def test_metapackage_metadata(testing_config, testing_workdir): os.path.join( testing_config.croot, testing_config.host_subdir, - "metapackage_testing_metadata-1.0-0.tar.bz2", + "metapackage_testing_metadata-1.0-0.conda", ) )[0] assert os.path.isfile(test_path) diff --git a/tests/cli/test_main_render.py b/tests/cli/test_main_render.py index ef5fdf077d..85ef6fd5fa 100644 --- a/tests/cli/test_main_render.py +++ b/tests/cli/test_main_render.py @@ -70,7 +70,7 @@ def test_render_output_build_path( test_path = os.path.join( testing_config.croot, testing_metadata.config.host_subdir, - "test_render_output_build_path-1.0-1.tar.bz2", + "test_render_output_build_path-1.0-1.conda", ) output, error = capfd.readouterr() assert output.rstrip() == test_path, error @@ -87,7 +87,7 @@ def test_render_output_build_path_and_file( test_path = os.path.join( testing_config.croot, testing_metadata.config.host_subdir, - "test_render_output_build_path_and_file-1.0-1.tar.bz2", + "test_render_output_build_path_and_file-1.0-1.conda", ) output, error = capfd.readouterr() assert output.rstrip() == test_path, error @@ -113,10 +113,8 @@ def test_render_output_build_path_set_python(testing_workdir, testing_metadata, main_render.execute(args) _hash = metadata.hash_dependencies() - test_path = ( - "test_render_output_build_path_set_python-1.0-py{}{}{}_1.tar.bz2".format( - version.split(".")[0], version.split(".")[1], _hash - ) + test_path = "test_render_output_build_path_set_python-1.0-py{}{}{}_1.conda".format( + version.split(".")[0], version.split(".")[1], _hash ) output, error = capfd.readouterr() assert os.path.basename(output.rstrip()) == test_path, error diff --git a/tests/cli/test_main_skeleton.py b/tests/cli/test_main_skeleton.py index 51aa78a014..c2dd0a65b5 100644 --- a/tests/cli/test_main_skeleton.py +++ b/tests/cli/test_main_skeleton.py @@ -7,9 +7,6 @@ from conda_build import api from conda_build.cli import main_build, main_skeleton -# FUTURE: Remove after 25.1 -DEFAULT_PACKAGE_FORMAT_FLAG = "--package-format=1" - @pytest.mark.sanity def test_skeleton_pypi(testing_workdir, testing_config): @@ -18,7 +15,7 @@ def test_skeleton_pypi(testing_workdir, testing_config): assert os.path.isdir("peppercorn") # ensure that recipe generated is buildable - main_build.execute(("peppercorn", DEFAULT_PACKAGE_FORMAT_FLAG)) + main_build.execute(("peppercorn",)) @pytest.mark.sanity diff --git a/tests/test_api_build.py b/tests/test_api_build.py index 3e70dd64fe..dd647ac8d4 100644 --- a/tests/test_api_build.py +++ b/tests/test_api_build.py @@ -248,7 +248,7 @@ def test_git_describe_info_on_branch(testing_config): test_path = os.path.join( testing_config.croot, testing_config.host_subdir, - "git_describe_number_branch-1.20.2.0-1_g82c6ba6.tar.bz2", + "git_describe_number_branch-1.20.2.0-1_g82c6ba6.conda", ) assert test_path == output @@ -307,7 +307,8 @@ def test_output_build_path_git_source(testing_config): test_path = os.path.join( testing_config.croot, testing_config.host_subdir, - f"conda-build-test-source-git-jinja2-1.20.2-py{sys.version_info.major}{sys.version_info.minor}{_hash}_0_g262d444.tar.bz2", + "conda-build-test-source-git-jinja2-1.20.2-" + f"py{sys.version_info.major}{sys.version_info.minor}{_hash}_0_g262d444.conda", ) assert output == test_path @@ -576,6 +577,7 @@ def test_requirements_txt_for_run_reqs(testing_config): reason="Python 3.10+, py_compile terminates once it finds an invalid file", ) def test_compileall_compiles_all_good_files(testing_config): + testing_config.conda_pkg_format = 1 output = api.build( os.path.join(metadata_dir, "_compile-test"), config=testing_config )[0] @@ -625,7 +627,7 @@ def test_numpy_setup_py_data(testing_config): _hash = metadata.hash_dependencies() assert ( os.path.basename(api.get_output_file_paths(metadata)[0]) - == f"load_setup_py_test-0.1.0-np116py{sys.version_info.major}{sys.version_info.minor}{_hash}_0.tar.bz2" + == f"load_setup_py_test-0.1.0-np116py{sys.version_info.major}{sys.version_info.minor}{_hash}_0.conda" ) @@ -879,6 +881,7 @@ def test_about_json_content(testing_metadata): "name,field", [("license", "license_file"), ("prelink_message", "prelink_message")] ) def test_about_license_file_and_prelink_message(testing_config, name, field): + testing_config.conda_pkg_format = 1 base_dir = os.path.join(metadata_dir, f"_about_{field}/recipes") recipe = os.path.join(base_dir, "single") @@ -945,6 +948,7 @@ def test_noarch_python_1(testing_config): @pytest.mark.sanity def test_skip_compile_pyc(testing_config): + testing_config.conda_pkg_format = 1 outputs = api.build( os.path.join(metadata_dir, "skip_compile_pyc"), config=testing_config ) @@ -969,6 +973,7 @@ def test_skip_compile_pyc(testing_config): def test_detect_binary_files_with_prefix(testing_config): + testing_config.conda_pkg_format = 1 outputs = api.build( os.path.join(metadata_dir, "_detect_binary_files_with_prefix"), config=testing_config, @@ -991,6 +996,7 @@ def test_detect_binary_files_with_prefix(testing_config): def test_skip_detect_binary_files_with_prefix(testing_config): + testing_config.conda_pkg_format = 1 recipe = os.path.join(metadata_dir, "_skip_detect_binary_files_with_prefix") outputs = api.build(recipe, config=testing_config) matches = [] @@ -1014,6 +1020,7 @@ def test_skip_detect_binary_files_with_prefix(testing_config): def test_fix_permissions(testing_config): + testing_config.conda_pkg_format = 1 recipe = os.path.join(metadata_dir, "fix_permissions") outputs = api.build(recipe, config=testing_config) with tarfile.open(outputs[0]) as tf: @@ -1050,6 +1057,7 @@ def test_output_folder_moves_file(testing_metadata, testing_workdir): "pkg_dirs to conda_pkgs_dir.", ) def test_info_files_json(testing_config): + testing_config.conda_pkg_format = 1 outputs = api.build( os.path.join(metadata_dir, "_ignore_some_prefix_files"), config=testing_config ) @@ -1611,6 +1619,7 @@ def test_source_cache_build(testing_workdir): @pytest.mark.slow def test_copy_test_source_files(testing_config): + testing_config.conda_pkg_format = 1 recipe = os.path.join(metadata_dir, "_test_test_source_files") filenames = set() for copy in (False, True): @@ -1959,6 +1968,7 @@ def test_activated_prefixes_in_actual_path(testing_metadata): """ file = "env-path-dump" testing_metadata.config.activate = True + testing_metadata.config.conda_pkg_format = 1 meta = testing_metadata.meta meta["requirements"]["host"] = [] meta["build"]["script"] = [ diff --git a/tests/test_api_convert.py b/tests/test_api_convert.py index 9b0526ed54..81353a0a70 100644 --- a/tests/test_api_convert.py +++ b/tests/test_api_convert.py @@ -180,6 +180,7 @@ def test_convert_platform_to_others(base_platform, package): on_win, reason="we create the pkg to be converted in *nix; don't run on win." ) def test_convert_from_unix_to_win_creates_entry_points(testing_config, request): + testing_config.conda_pkg_format = 1 recipe_dir = os.path.join(metadata_dir, "entry_points") # Recipe "entry_points" is used in other test -> add test-specific variant # (change build hash) to avoid clashes in package cache from other tests. diff --git a/tests/test_api_render.py b/tests/test_api_render.py index eb75a283d9..5a01dc0989 100644 --- a/tests/test_api_render.py +++ b/tests/test_api_render.py @@ -70,7 +70,7 @@ def test_get_output_file_paths(testing_workdir, testing_metadata): assert build_path == os.path.join( testing_metadata.config.croot, testing_metadata.config.host_subdir, - "test_get_output_file_paths-1.0-1.tar.bz2", + "test_get_output_file_paths-1.0-1.conda", ) @@ -80,7 +80,7 @@ def test_get_output_file_paths_metadata_object(testing_metadata): assert build_path == os.path.join( testing_metadata.config.croot, testing_metadata.config.host_subdir, - "test_get_output_file_paths_metadata_object-1.0-1.tar.bz2", + "test_get_output_file_paths_metadata_object-1.0-1.conda", ) @@ -104,7 +104,7 @@ def test_get_output_file_paths_jinja2(testing_config): assert build_path == os.path.join( testing_config.croot, testing_config.host_subdir, - f"conda-build-test-source-git-jinja2-1.20.2-py{python}{_hash}_0_g262d444.tar.bz2", + f"conda-build-test-source-git-jinja2-1.20.2-py{python}{_hash}_0_g262d444.conda", ) diff --git a/tests/test_subpackages.py b/tests/test_subpackages.py index 881a4eb4cb..9f5c9b800e 100644 --- a/tests/test_subpackages.py +++ b/tests/test_subpackages.py @@ -469,9 +469,7 @@ def test_loops_do_not_remove_earlier_packages(testing_config): api.build(recipe, config=testing_config) assert len(output_files) == len( - glob( - os.path.join(testing_config.croot, testing_config.host_subdir, "*.tar.bz2") - ) + glob(os.path.join(testing_config.croot, testing_config.host_subdir, "*.conda")) ) @@ -484,8 +482,8 @@ def test_build_string_does_not_incorrectly_add_hash(testing_config): recipe = os.path.join(subpackage_dir, "_build_string_with_variant") output_files = api.get_output_file_paths(recipe, config=testing_config) assert len(output_files) == 4 - assert any("clang_variant-1.0-cling.tar.bz2" in f for f in output_files) - assert any("clang_variant-1.0-default.tar.bz2" in f for f in output_files) + assert any("clang_variant-1.0-cling.conda" in f for f in output_files) + assert any("clang_variant-1.0-default.conda" in f for f in output_files) def test_multi_outputs_without_package_version(testing_config): @@ -493,9 +491,9 @@ def test_multi_outputs_without_package_version(testing_config): recipe = os.path.join(subpackage_dir, "_multi_outputs_without_package_version") outputs = api.build(recipe, config=testing_config) assert len(outputs) == 3 - assert outputs[0].endswith("a-1-0.tar.bz2") - assert outputs[1].endswith("b-2-0.tar.bz2") - assert outputs[2].endswith("c-3-0.tar.bz2") + assert outputs[0].endswith("a-1-0.conda") + assert outputs[1].endswith("b-2-0.conda") + assert outputs[2].endswith("c-3-0.conda") def test_empty_outputs_requires_package_version(testing_config):