diff --git a/.github/workflows/artifacts-build.yml b/.github/workflows/artifacts-build.yml index f588264cdfb..4a5a0e76113 100644 --- a/.github/workflows/artifacts-build.yml +++ b/.github/workflows/artifacts-build.yml @@ -572,70 +572,6 @@ jobs: git checkout empty gsutil -m cp -r benchmarks/binsize/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/binsize - # Data size benchmark: track size of provider/datagen/tests/data/testdata.postcard (total data size). - bench-datasize: - # This is too expensive to run on every push, so only run it on main. - # When running on a PR, comment this out and set the BASELINE variable below to the baseline commit. - if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x' - concurrency: - # Allow one run at a time to include the previous run's results - group: bench-datasize - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - # GCP Boilerplate for jobs in main repository - - id: gcp-auth - name: "Authenticate to Google Cloud with Workload Identity Provider" - uses: google-github-actions/auth@v1 - with: - workload_identity_provider: "projects/66042061814/locations/global/workloadIdentityPools/icu4x-gha-pool1/providers/icu4x-gha-provider1" - service_account: "icu4x-main@dev-infra-273822.iam.gserviceaccount.com" - - name: "Set up Google Cloud SDK" - uses: google-github-actions/setup-gcloud@v1 - - - name: Install rustfmt - run: | - rustup component add rustfmt - - - name: Setup output data directory - run: | - mkdir -p benchmarks/datasize - - - name: Generate testdata - run: | - cargo run --bin make-testdata-legacy --manifest-path tools/testdata-scripts/Cargo.toml - - - name: Measure size of selected data package provider/testdata/data/testdata.postcard - run: | - cargo run --package icu_benchmark_binsize -- provider/testdata/data/testdata.postcard file | tee benchmarks/datasize/output.txt - - - name: Download previous benchmark data - run: | - mkdir -p benchmarks - gsutil -m cp -rn gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/datasize/* benchmarks/datasize - - - name: Store benchmark result & create dashboard - # Use gregtatum special feature to process ndjson-formatted benchmark data - uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12 - with: - tool: 'ndjson' - output-file-path: benchmarks/datasize/output.txt - benchmark-data-dir-path: ./benchmarks/datasize - # Tentative setting, optimized value to be determined - alert-threshold: '100%' - fail-on-alert: false - # comment-on-alert: true - github-token: ${{ secrets.GITHUB_TOKEN }} - gh-pages-branch: empty - # alert-comment-cc-users: '@gnrunge,@sffc,@zbraniecki,@echeran' - - - name: Upload new benchmark data - if: success() || failure() - run: | - git checkout empty - gsutil -m cp -r benchmarks/datasize/* gs://${{ env.GCP_MAIN_BUCKET_ID }}/gha/benchmarks/datasize - gh-pages: name: "Deploy to GitHub Pages" needs: [rust-docs, cpp-docs, ts-docs, dart-docs, wasm-demo, bench-perf, bench-memory, bench-datasize] # bench-binsize diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 61b48fdc031..defb0f54aa6 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -196,35 +196,6 @@ jobs: - name: Run `cargo make ci-job-testdata` run: cargo make ci-job-testdata - - # ci-job-testdata-legacy - testdata-legacy: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - # Cargo-make boilerplate - - name: Install cargo-make - uses: taiki-e/install-action@cargo-make - - # Toolchain boilerplate - - name: Potentially override rust version with nightly - run: cargo make set-ci-toolchain - - name: Show the selected Rust toolchain - run: rustup show - - # Job-specific dependencies - - name: Install cargo-binstall - uses: taiki-e/install-action@cargo-binstall - - name: Install cargo-all-features - run: cargo-binstall -y cargo-all-features - - # Actual job - - name: Run `cargo make ci-job-testdata-legacy` - run: cargo make ci-job-testdata-legacy - - # ci-job-full-datagen full-datagen: runs-on: ubuntu-latest @@ -561,7 +532,7 @@ jobs: # Notify on slack notify-slack: - needs: [msrv, test, testdata, testdata-legacy, test-docs, full-datagen, test-c, test-js, test-dart, nostd, diplomat, gn, fmt, tidy, clippy, doc] + needs: [msrv, test, testdata, test-docs, full-datagen, test-c, test-js, test-dart, nostd, diplomat, gn, fmt, tidy, clippy, doc] if: ${{ always() && contains(needs.*.result, 'failure') && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_name == 'main')) }} runs-on: ubuntu-latest steps: diff --git a/Cargo.lock b/Cargo.lock index deead13b7e9..a53f8c498fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1558,13 +1558,11 @@ version = "0.0.0" dependencies = [ "clap", "crlify", - "databake", "eyre", "icu_datagen", "icu_locid", "icu_provider", "log", - "quote", "simple_logger", "ureq", "zip", diff --git a/Cargo.toml b/Cargo.toml index 76bd66e9cdc..e875ac9e7ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,11 +92,6 @@ members = [ # Note: Workspaces in subdirectories, such as tutorials/crates, are # implicitly excluded from the main workspace. exclude = [ - # Testdata will still be published in the 1.x stream, but is deprecated - # and we don't use it anymore. As we don't want to keep the actual data - # in the repo it doesn't build without running `cargo make testdata-legacy` - # first. - "provider/testdata", # Tutorials are tested outside the workspace to simulate external users "tutorials", ] diff --git a/Makefile.toml b/Makefile.toml index 9c89ac2f2a1..fe821f9863c 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -97,14 +97,6 @@ dependencies = [ "testdata-check", ] -[tasks.ci-job-testdata-legacy] -description = "Run all tests for the CI 'testdata' job" -category = "CI" -dependencies = [ - "testdata-legacy", - "testdata-legacy-test", -] - [tasks.ci-job-test-docs] description = "Run all tests for the CI 'test-docs' job" category = "CI" diff --git a/provider/testdata/.gitignore b/provider/testdata/.gitignore deleted file mode 100644 index 6320cd248dd..00000000000 --- a/provider/testdata/.gitignore +++ /dev/null @@ -1 +0,0 @@ -data \ No newline at end of file diff --git a/provider/testdata/Cargo.lock b/provider/testdata/Cargo.lock deleted file mode 100644 index bceeee86f68..00000000000 --- a/provider/testdata/Cargo.lock +++ /dev/null @@ -1,1196 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "anstyle" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "calendrical_calculations" -version = "0.1.1" -dependencies = [ - "core_maths", - "displaydoc", -] - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" - -[[package]] -name = "ciborium-ll" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "4.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" -dependencies = [ - "anstyle", - "clap_lex", -] - -[[package]] -name = "clap_lex" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" - -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - -[[package]] -name = "core_maths" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b02505ccb8c50b0aa21ace0fc08c3e53adebd4e58caa18a36152803c7709a3" -dependencies = [ - "libm", -] - -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "fixed_decimal" -version = "0.5.6" -dependencies = [ - "displaydoc", - "smallvec", - "writeable", -] - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "icu" -version = "1.5.0" -dependencies = [ - "icu_calendar", - "icu_casemap", - "icu_collator", - "icu_collections", - "icu_datetime", - "icu_decimal", - "icu_list", - "icu_locid", - "icu_locid_transform", - "icu_normalizer", - "icu_plurals", - "icu_properties", - "icu_provider", - "icu_segmenter", - "icu_timezone", -] - -[[package]] -name = "icu_calendar" -version = "1.5.0" -dependencies = [ - "calendrical_calculations", - "displaydoc", - "icu_locid", - "icu_provider", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_casemap" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid", - "icu_properties", - "icu_provider", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_collator" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "zerovec", -] - -[[package]] -name = "icu_collections" -version = "1.5.0" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_datetime" -version = "1.5.0" -dependencies = [ - "displaydoc", - "either", - "fixed_decimal", - "icu_calendar", - "icu_decimal", - "icu_locid", - "icu_plurals", - "icu_provider", - "icu_timezone", - "litemap", - "smallvec", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_decimal" -version = "1.5.0" -dependencies = [ - "displaydoc", - "fixed_decimal", - "icu_provider", - "writeable", -] - -[[package]] -name = "icu_experimental" -version = "0.1.0" -dependencies = [ - "displaydoc", - "fixed_decimal", - "icu_collections", - "icu_decimal", - "icu_locid", - "icu_locid_transform", - "icu_normalizer", - "icu_pattern", - "icu_plurals", - "icu_properties", - "icu_provider", - "litemap", - "num-bigint", - "num-rational", - "num-traits", - "smallvec", - "tinystr", - "writeable", - "zerofrom", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_list" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_provider", - "regex-automata 0.2.0", - "writeable", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -dependencies = [ - "displaydoc", - "litemap", - "serde", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider", - "serde", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_pattern" -version = "0.1.0" -dependencies = [ - "displaydoc", - "either", - "writeable", - "yoke", - "zerofrom", -] - -[[package]] -name = "icu_plurals" -version = "1.5.0" -dependencies = [ - "displaydoc", - "fixed_decimal", - "icu_provider", - "zerovec", -] - -[[package]] -name = "icu_properties" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_provider" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "postcard", - "serde", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_adapters" -version = "1.5.0" -dependencies = [ - "icu_locid", - "icu_locid_transform", - "icu_provider", - "serde", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_provider_blob" -version = "1.5.0" -dependencies = [ - "icu_provider", - "postcard", - "serde", - "writeable", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "icu_segmenter" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid", - "icu_provider", - "utf8_iter", - "zerovec", -] - -[[package]] -name = "icu_testdata" -version = "1.5.0" -dependencies = [ - "criterion", - "icu", - "icu_calendar", - "icu_casemap", - "icu_collator", - "icu_collections", - "icu_datetime", - "icu_decimal", - "icu_experimental", - "icu_list", - "icu_locid", - "icu_locid_transform", - "icu_normalizer", - "icu_pattern", - "icu_plurals", - "icu_properties", - "icu_provider", - "icu_provider_adapters", - "icu_provider_blob", - "icu_segmenter", - "icu_timezone", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_timezone" -version = "1.5.0" -dependencies = [ - "displaydoc", - "icu_calendar", - "icu_provider", - "tinystr", - "zerotrie", - "zerovec", -] - -[[package]] -name = "is-terminal" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" - -[[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" - -[[package]] -name = "libm" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - -[[package]] -name = "litemap" -version = "0.7.3" -dependencies = [ - "serde", -] - -[[package]] -name = "log" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "plotters" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" - -[[package]] -name = "plotters-svg" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "postcard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa512cd0d087cc9f99ad30a1bf64795b67871edbead083ffc3a4dfafa59aa00" -dependencies = [ - "cobs", - "serde", -] - -[[package]] -name = "proc-macro2" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - -[[package]] -name = "regex" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.3.0", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9368763f5a9b804326f3af749e16f9abf378d227bcdee7634b13d8f17793782" -dependencies = [ - "memchr", -] - -[[package]] -name = "regex-automata" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" - -[[package]] -name = "ryu" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "serde" -version = "1.0.166" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.166" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "syn" -version = "2.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "285ba80e733fac80aa4270fbcdf83772a79b80aa35c97075320abfee4a915b06" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "tinystr" -version = "0.7.6" -dependencies = [ - "displaydoc", - "serde", - "zerovec", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "utf16_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52df8b7fb78e7910d776fccf2e42ceaf3604d55e8e7eb2dbd183cb1441d8a692" - -[[package]] -name = "utf8_iter" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a8922555b9500e3d865caed19330172cd67cbf82203f1a3311d8c305cc9f33" - -[[package]] -name = "walkdir" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "web-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -dependencies = [ - "either", -] - -[[package]] -name = "yoke" -version = "0.7.4" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerotrie" -version = "0.1.3" -dependencies = [ - "displaydoc", - "litemap", - "serde", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "zerovec" -version = "0.10.2" -dependencies = [ - "serde", - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/provider/testdata/Cargo.toml b/provider/testdata/Cargo.toml deleted file mode 100644 index bea30fef33a..00000000000 --- a/provider/testdata/Cargo.toml +++ /dev/null @@ -1,105 +0,0 @@ -# This file is part of ICU4X. For terms of use, please see the file -# called LICENSE at the top level of the ICU4X source tree -# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). - -[package] -name = "icu_testdata" -description = "Pre-built test data for ICU4X" -version = "1.5.0" -rust-version = "1.67.0" -authors = ["The ICU4X Project Developers"] -edition = "2021" -readme = "README.md" -repository = "https://github.com/unicode-org/icu4x" -homepage = "https://icu4x.unicode.org" -license = "Unicode-3.0" -categories = ["internationalization"] -# Keep this in sync with other crates unless there are exceptions -include = [ - "src/**/*", - "examples/**/*", - "benches/**/*", - "tests/**/*", - "Cargo.toml", - "LICENSE", - "README.md", - # Exception: We want to be able to run tests, so - # we include the test data - "data/**/*", - "!data/postcard/**/*", -] - -[package.metadata.docs.rs] -all-features = true - -[dependencies] -icu_provider = { version = "~1.5.0", path = "../core", default-features = false } -icu_provider_adapters = { version = "~1.5.0", path = "../adapters", default-features = false } - -# buffer feature -icu_provider_blob = { version = "~1.5.0", path = "../blob", default-features = false, optional = true } - -# databake deps -icu_locid = { version = "~1.5.0", path = "../../components/locid", default-features = false } -icu_collections = { version = "~1.5.0", path = "../../components/collections", default-features = false } -icu_pattern = { version = "0.2.0", path = "../../utils/pattern", default-features = false } -zerovec = { version = "0.10.0", path = "../../utils/zerovec", default-features = false } -zerotrie = { version = "0.1.0", path = "../../utils/zerotrie" } - -# databake options -icu_calendar = { version = "~1.5.0", path = "../../components/calendar", default-features = false, optional = true } -icu_casemap = { version = "~1.5.0", path = "../../components/casemap", default-features = false, optional = true } -icu_collator = { version = "~1.5.0", path = "../../components/collator", default-features = false, optional = true } -icu_datetime = { version = "~1.5.0", path = "../../components/datetime", default-features = false, optional = true } -icu_decimal = { version = "~1.5.0", path = "../../components/decimal", default-features = false, optional = true } -icu_list = { version = "~1.5.0", path = "../../components/list", default-features = false, optional = true } -icu_locid_transform = { version = "~1.5.0", path = "../../components/locid_transform", default-features = false, optional = true } -icu_normalizer = { version = "~1.5.0", path = "../../components/normalizer", default-features = false, optional = true } -icu_plurals = { version = "~1.5.0", path = "../../components/plurals", default-features = false, optional = true } -icu_properties = { version = "~1.5.0", path = "../../components/properties", default-features = false, optional = true } -icu_segmenter = { version = "~1.5.0", path = "../../components/segmenter", default-features = false, optional = true } -icu_timezone = { version = "~1.5.0", path = "../../components/timezone", default-features = false, optional = true } - -icu_experimental = { version = "0.1.0", path = "../../components/experimental", default-features = false, optional = true } - -[dev-dependencies] -icu = { path = "../../components/icu", default-features = false } - -[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] -criterion = "0.5" - - -[features] -default = [ - "icu_calendar", - "icu_collator", - "icu_datetime", - "icu_decimal", - "icu_list", - "icu_locid_transform", - "icu_normalizer", - "icu_plurals", - "icu_properties", - "icu_segmenter", - "icu_timezone", -] -icu_datetime_experimental = [ - "icu_datetime/experimental", -] -icu_plurals_experimental = [ - "icu_plurals/experimental", -] -buffer = ["dep:icu_provider_blob", "icu_provider/sync", "icu_provider_adapters/serde"] -std = [] - -[package.metadata.cargo-all-features] -skip_optional_dependencies = true -denylist = ["internal_all_features_hack"] -extra_features = [ - "icu_datetime", - "icu_list", -] - -[[bench]] -name = "providers" -harness = false diff --git a/provider/testdata/LICENSE b/provider/testdata/LICENSE deleted file mode 100644 index c9be6012c53..00000000000 --- a/provider/testdata/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -UNICODE LICENSE V3 - -COPYRIGHT AND PERMISSION NOTICE - -Copyright © 2020-2024 Unicode, Inc. - -NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR -SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT -DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of data files and any associated documentation (the "Data Files") or -software and any associated documentation (the "Software") to deal in the -Data Files or Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, and/or sell -copies of the Data Files or Software, and to permit persons to whom the -Data Files or Software are furnished to do so, provided that either (a) -this copyright and permission notice appear with all copies of the Data -Files or Software, or (b) this copyright and permission notice appear in -associated Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF -THIRD PARTY RIGHTS. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE -BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA -FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in these Data Files or Software without prior written -authorization of the copyright holder. - -SPDX-License-Identifier: Unicode-3.0 - -— - -Portions of ICU4X may have been adapted from ICU4C and/or ICU4J. -ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others. diff --git a/provider/testdata/README.md b/provider/testdata/README.md deleted file mode 100644 index 2a3dfb633a1..00000000000 --- a/provider/testdata/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# icu_testdata [![crates.io](https://img.shields.io/crates/v/icu_testdata)](https://crates.io/crates/icu_testdata) - -🚧 This crate has been superseded by `ICU4X`'s `compiled_data` feature and is deprecated. Data for new components will not be added, and it will not be updated for `ICU4X` 2.0. - - - -`icu_testdata` is a unit testing crate for [`ICU4X`]. - -The crate exposes data providers with stable data useful for unit testing. The data is -based on a CLDR tag and a short list of locales that, together, cover a range of scenarios. - -The crate exposes three kinds of providers, corresponding to the three types of constructors -in ICU: -* [`unstable`], [`unstable_no_fallback`] -* [`any`], [`any_no_fallback`] -* [`buffer`], [`buffer_no_fallback`] (`buffer` Cargo feature) - -## Examples - -```rust -use icu::locid::locale; -use icu_provider::hello_world::HelloWorldFormatter; - -// Unstable constructor -HelloWorldFormatter::try_new_unstable( - &icu_testdata::unstable(), - &locale!("en-CH").into(), -).unwrap(); - -// AnyProvider constructor -HelloWorldFormatter::try_new_with_any_provider( - &icu_testdata::any(), - &locale!("en-CH").into(), -).unwrap(); - -// BufferProvider constructor (`icu` with `serde` feature, `icu_testdata` with `buffer` feature) -HelloWorldFormatter::try_new_with_buffer_provider( - &icu_testdata::buffer(), - &locale!("en-CH").into(), -).unwrap(); - -// Without fallback the locale match needs to be exact -HelloWorldFormatter::try_new_unstable( - &icu_testdata::unstable_no_fallback(), - &locale!("en-CH").into(), -).is_err(); - -HelloWorldFormatter::try_new_unstable( - &icu_testdata::unstable_no_fallback(), - &locale!("en").into(), -).unwrap(); -``` - -[`ICU4X`]: https://docs.rs/icu/latest/icu/ - - - -## More Information - -For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/provider/testdata/benches/providers.rs b/provider/testdata/benches/providers.rs deleted file mode 100644 index bb6508f8eb3..00000000000 --- a/provider/testdata/benches/providers.rs +++ /dev/null @@ -1,113 +0,0 @@ -// This file is part of ICU4X. For terms of use, please see the file -// called LICENSE at the top level of the ICU4X source tree -// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). - -extern crate alloc; - -use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use icu_locid::langid; -use icu_provider::hello_world::HelloWorldV1Marker; -use icu_provider::prelude::*; -use icu_provider::AsDeserializingBufferProvider; -use icu_provider_blob::BlobDataProvider; - -static POSTCARD_BYTES: &[u8] = include_bytes!("../data/testdata.postcard"); - -struct BakedDataProvider; - -mod baked { - include!("../data/baked/mod.rs"); - impl_data_provider!(super::BakedDataProvider); - impl_any_provider!(super::BakedDataProvider); -} - -#[inline(never)] -fn create_static_data_provider() -> BlobDataProvider { - icu_provider_blob::BlobDataProvider::try_new_from_static_blob(POSTCARD_BYTES).unwrap() -} - -#[inline(never)] -fn create_blob_data_provider() -> BlobDataProvider { - icu_provider_blob::BlobDataProvider::try_new_from_blob(black_box(POSTCARD_BYTES.into())) - .unwrap() -} - -#[inline(never)] -fn create_baked_data_provider() -> BakedDataProvider { - BakedDataProvider -} - -#[inline(never)] -fn create_baked_any_provider() -> BakedDataProvider { - BakedDataProvider -} - -fn providers_bench(c: &mut Criterion) { - c.bench_function("provider/construct/static", |b| { - b.iter(create_static_data_provider); - }); - c.bench_function("provider/construct/blob", |b| { - b.iter(create_blob_data_provider); - }); - c.bench_function("provider/construct/baked", |b| { - b.iter(create_baked_data_provider); - }); - c.bench_function("provider/construct/any", |b| { - b.iter(create_baked_data_provider); - }); - - c.bench_function("provider/load/static", |b| { - let provider = create_static_data_provider(); - b.iter(|| { - let result: DataResponse = provider - .as_deserializing() - .load(DataRequest { - locale: &langid!("ja").into(), - metadata: Default::default(), - }) - .unwrap(); - result - }); - }); - c.bench_function("provider/load/blob", |b| { - let provider = create_blob_data_provider(); - b.iter(|| { - let result: DataResponse = provider - .as_deserializing() - .load(DataRequest { - locale: &langid!("ja").into(), - metadata: Default::default(), - }) - .unwrap(); - result - }); - }); - c.bench_function("provider/load/baked", |b| { - let provider = create_baked_data_provider(); - b.iter(|| { - let result: DataResponse = provider - .load(DataRequest { - locale: &langid!("ja").into(), - metadata: Default::default(), - }) - .unwrap(); - result - }); - }); - c.bench_function("provider/load/any", |b| { - let provider = create_baked_any_provider(); - b.iter(|| { - let result: DataResponse = provider - .as_downcasting() - .load(DataRequest { - locale: &langid!("ja").into(), - metadata: Default::default(), - }) - .unwrap(); - result - }); - }); -} - -criterion_group!(benches, providers_bench,); -criterion_main!(benches); diff --git a/provider/testdata/src/lib.rs b/provider/testdata/src/lib.rs deleted file mode 100644 index 11a72c56d22..00000000000 --- a/provider/testdata/src/lib.rs +++ /dev/null @@ -1,231 +0,0 @@ -// This file is part of ICU4X. For terms of use, please see the file -// called LICENSE at the top level of the ICU4X source tree -// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). - -//! `icu_testdata` is a unit testing crate for [`ICU4X`]. -//! -//! The crate exposes data providers with stable data useful for unit testing. The data is -//! based on a CLDR tag and a short list of locales that, together, cover a range of scenarios. -//! -//! The crate exposes three kinds of providers, corresponding to the three types of constructors -//! in ICU: -//! * [`unstable`], [`unstable_no_fallback`] -//! * [`any`], [`any_no_fallback`] -//! * [`buffer`], [`buffer_no_fallback`] (`buffer` Cargo feature) -//! -//! # Examples -//! -//! ``` -//! use icu::locid::locale; -//! use icu_provider::hello_world::HelloWorldFormatter; -//! -//! // Unstable constructor -//! HelloWorldFormatter::try_new_unstable( -//! &icu_testdata::unstable(), -//! &locale!("en-CH").into(), -//! ).unwrap(); -//! -//! // AnyProvider constructor -//! HelloWorldFormatter::try_new_with_any_provider( -//! &icu_testdata::any(), -//! &locale!("en-CH").into(), -//! ).unwrap(); -//! -//! // BufferProvider constructor (`icu` with `serde` feature, `icu_testdata` with `buffer` feature) -//! HelloWorldFormatter::try_new_with_buffer_provider( -//! &icu_testdata::buffer(), -//! &locale!("en-CH").into(), -//! ).unwrap(); -//! -//! // Without fallback the locale match needs to be exact -//! HelloWorldFormatter::try_new_unstable( -//! &icu_testdata::unstable_no_fallback(), -//! &locale!("en-CH").into(), -//! ).is_err(); -//! -//! HelloWorldFormatter::try_new_unstable( -//! &icu_testdata::unstable_no_fallback(), -//! &locale!("en").into(), -//! ).unwrap(); -//! ``` -//! -//! [`ICU4X`]: https://docs.rs/icu/latest/icu/ - -// https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations -#![cfg_attr(not(any(test, feature = "std")), no_std)] -#![cfg_attr( - not(test), - deny( - clippy::indexing_slicing, - clippy::unwrap_used, - clippy::expect_used, - clippy::panic, - clippy::exhaustive_structs, - clippy::exhaustive_enums, - missing_debug_implementations, - ) -)] -#![warn(missing_docs)] -#![allow(unused_imports)] // too many feature combinations too keep track of -#![allow(deprecated)] -#![deprecated(since = "1.3.0", note = "this crate has been superseded by `ICU4X`'s `compiled_data` feature. Data for new components will not be added, and it will not be updated for `ICU4X` 2.0.")] - -extern crate alloc; - -#[path = "../data/metadata.rs.data"] -mod metadata; - -#[deprecated(since = "1.3.0")] -pub mod versions { - //! Functions to access version info of the ICU test data. - - /// Gets the CLDR tag used as the test data source (for formatters, likely subtags, ...) - /// - /// # Examples - /// - /// ``` - /// assert_eq!("44.0.0", icu_testdata::versions::cldr_tag()); - /// ``` - #[deprecated(since = "1.3.0")] - pub fn cldr_tag() -> alloc::string::String { - alloc::string::String::from(super::metadata::CLDR_TAG) - } - - /// Gets the ICU tag used as the test data source (for properties, collator, ...) - /// - /// # Examples - /// - /// ``` - /// assert_eq!("release-74-1", icu_testdata::versions::icu_tag()); - /// ``` - #[deprecated(since = "1.3.0")] - pub fn icu_tag() -> alloc::string::String { - alloc::string::String::from(super::metadata::ICUEXPORT_TAG) - } -} - -/// Gets the locales supported by the test data. -/// -/// # Examples -/// -/// ``` -/// # use icu_locid::langid; -/// assert!(icu_testdata::locales().contains(&langid!("es-AR"))); -/// assert!(icu_testdata::locales().len() > 10); -/// ``` -#[deprecated(since = "1.3.0")] -pub fn locales() -> alloc::vec::Vec { - alloc::vec::Vec::from(metadata::LOCALES) -} - -#[cfg(feature = "std")] -#[deprecated(since = "1.3.0")] -/// Get paths to the test data directories. Some of these paths do not -/// exist anymore, and data should only be accessed through the functions -/// provided by this crate. -pub mod paths { - use std::path::PathBuf; - - #[deprecated(since = "1.3.0")] - /// Returns the absolute path to the top-level data directory. - pub fn data_root() -> PathBuf { - PathBuf::from(std::env!("CARGO_MANIFEST_DIR")).join("data") - } - - #[deprecated(since = "1.3.0")] - /// Returns the absolute path to the CLDR JSON root directory. - pub fn cldr_json_root() -> PathBuf { - data_root().join("cldr") - } - - #[deprecated(since = "1.3.0")] - /// Returns the absolute path to the icuexport TOML root directory. - pub fn icuexport_toml_root() -> PathBuf { - data_root().join("icuexport") - } - - #[deprecated(since = "1.3.0")] - /// Returns the absolute path to the collation tailoring TOML root directory. - pub fn coll_toml_root() -> PathBuf { - data_root().join("coll") - } -} - -use icu_provider::prelude::*; -use icu_provider_adapters::fallback::LocaleFallbackProvider; - -/// A data provider that is compatible with all ICU `_unstable` constructors. -/// -/// The return type of this method is not considered stable, mirroring the unstable trait -/// bounds of the constructors. For matching versions of `icu` and `icu_testdata`, however, -/// these are guaranteed to match. -#[cfg(feature = "icu_locid_transform")] -#[deprecated(since = "1.3.0", note = "use `compiled_data`")] -pub fn unstable() -> LocaleFallbackProvider { - // The statically compiled data file is valid. - #[allow(clippy::unwrap_used)] - LocaleFallbackProvider::try_new_unstable(unstable_no_fallback()).unwrap() -} - -/// A data provider that is compatible with all ICU `_unstable` constructors. -/// -/// The return type of this method is not considered stable, mirroring the unstable trait -/// bounds of the constructors. For matching versions of `icu` and `icu_testdata`, however, -/// these are guaranteed to match. -#[deprecated(since = "1.3.0", note = "use `compiled_data`")] -pub fn unstable_no_fallback() -> UnstableDataProvider { - UnstableDataProvider -} - -/// An [`AnyProvider`] backed by baked data. -#[cfg(feature = "icu_locid_transform")] -#[deprecated(since = "1.3.0", note = "use `compiled_data`")] -pub fn any() -> impl AnyProvider { - // The baked data is valid. - #[allow(clippy::unwrap_used)] - LocaleFallbackProvider::try_new_with_any_provider(any_no_fallback()).unwrap() -} - -/// An [`AnyProvider`] backed by baked data. -#[deprecated(since = "1.3.0", note = "use `compiled_data`")] -pub fn any_no_fallback() -> impl AnyProvider { - UnstableDataProvider -} - -/// A [`BufferProvider`] backed by a Postcard blob. -/// -/// This deserializes a large data blob from static memory, please cache the result if you -/// are calling this repeatedly and care about performance -#[cfg(feature = "buffer")] -#[deprecated(since = "1.3.0", note = "use `compiled_data`")] -pub fn buffer() -> impl BufferProvider { - // The statically compiled data file is valid. - #[allow(clippy::unwrap_used)] - LocaleFallbackProvider::try_new_with_buffer_provider(buffer_no_fallback()).unwrap() -} - -/// A [`BufferProvider`] backed by a Postcard blob. -/// -/// This deserializes a large data blob from static memory, please cache the result if you -/// are calling this repeatedly and care about performance -#[cfg(feature = "buffer")] -#[deprecated(since = "1.3.0", note = "use `compiled_data`")] -pub fn buffer_no_fallback() -> impl BufferProvider { - #[allow(clippy::unwrap_used)] // The statically compiled data file is valid. - icu_provider_blob::BlobDataProvider::try_new_from_static_blob(include_bytes!( - "../data/testdata.postcard" - )) - .unwrap() -} - -#[doc(hidden)] -#[non_exhaustive] -#[derive(Debug)] -#[deprecated(since = "1.3.0", note = "use `compiled_data`")] -pub struct UnstableDataProvider; - -mod baked { - include!("../data/baked/mod.rs"); - impl_data_provider!(super::UnstableDataProvider); - impl_any_provider!(super::UnstableDataProvider); -} diff --git a/tools/make/data.toml b/tools/make/data.toml index 58e2adc7be2..0fc6d3a27d5 100644 --- a/tools/make/data.toml +++ b/tools/make/data.toml @@ -75,30 +75,6 @@ if greater_than ${output_length} 0 end ''' -[tasks.testdata-legacy] -description = "Build the data for the legacy icu_testdata crate" -category = "ICU4X Data" -command = "cargo" -args = [ - "run", - "--bin=make-testdata-legacy", - "--release", - "--manifest-path=tools/testdata-scripts/Cargo.toml", # avoid global feature resolution -] - -[tasks.testdata-legacy-test] -description = "Verify the data for the legacy icu_testdata crate" -category = "ICU4X Data" -script_runner = "@duckscript" -script = """ - cd provider/testdata - set_env CARGO_TARGET_DIR "../../target" - exec --fail-on-error cargo check-all-features - exec --fail-on-error cargo test --all-features --all-targets - set_env RUSTDOCFLAGS -Dwarnings - exec --fail-on-error cargo doc --all-features --no-deps -""" - [tasks.bakeddata] description = "Builds full baked data" category = "ICU4X Data" diff --git a/tools/testdata-scripts/Cargo.toml b/tools/testdata-scripts/Cargo.toml index b5cfcf51ad4..0b6ac2a4a1c 100644 --- a/tools/testdata-scripts/Cargo.toml +++ b/tools/testdata-scripts/Cargo.toml @@ -10,15 +10,13 @@ edition = "2021" [dependencies] crlify = { workspace = true } -databake = { workspace = true } -icu_datagen = { workspace = true, features = ["legacy_api", "use_wasm", "networking", "experimental_components"] } +icu_datagen = { workspace = true, features = ["provider"] } icu_locid = { workspace = true, features = ["databake"] } icu_provider = { workspace = true } clap = { workspace = true, features = ["derive"] } eyre = { workspace = true } log = { workspace = true } -quote = { workspace = true } simple_logger = { workspace = true } ureq = { workspace = true } zip = { workspace = true, features = ["deflate"] } diff --git a/tools/testdata-scripts/src/bin/make-testdata-legacy.rs b/tools/testdata-scripts/src/bin/make-testdata-legacy.rs deleted file mode 100644 index 46685caccf3..00000000000 --- a/tools/testdata-scripts/src/bin/make-testdata-legacy.rs +++ /dev/null @@ -1,88 +0,0 @@ -// This file is part of ICU4X. For terms of use, please see the file -// called LICENSE at the top level of the ICU4X source tree -// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). - -use icu_datagen::prelude::*; -use std::fs::File; -use std::io::Write; -use std::path::Path; - -include!("../../../../provider/datagen/tests/locales.rs.data"); - -fn main() { - #![allow(deprecated)] // want to keep old datagen code path covered - - simple_logger::SimpleLogger::new() - .env() - .with_level(log::LevelFilter::Info) - .init() - .unwrap(); - - let data_root = Path::new(concat!( - core::env!("CARGO_MANIFEST_DIR"), - "/../../provider/testdata/data/" - )); - - std::fs::create_dir_all(data_root).unwrap(); - - let source = SourceData::default() - .with_cldr_latest(Default::default()) - .unwrap() - .with_icuexport_latest() - .unwrap(); - - let blob_out = Out::Blob(Box::new( - File::create(data_root.join("testdata.postcard")).unwrap(), - )); - - let mut options = BakedOptions::default(); - options.insert_feature_gates = true; - options.use_separate_crates = true; - options.overwrite = true; - let mod_out = Out::Baked { - mod_directory: data_root.join("baked"), - options, - }; - - icu_datagen::datagen( - Some(LOCALES), - &icu_datagen::all_keys_with_experimental() - .into_iter() - .chain([icu_provider::hello_world::HelloWorldV1Marker::KEY]) - .collect::>(), - &source, - vec![blob_out, mod_out], - ) - .unwrap(); - - let mut metadata = File::create(data_root.join("metadata.rs.data")).unwrap(); - - metadata - .write_all( - "\ - // DO NOT EDIT\n\ - // This file is generated by `make-testdata` from\n\ - // * locales.rs.data,\n\ - // * `icu_datagen::SourceData::LATEST_TESTED_*`.\n\ - \n\ - " - .as_bytes(), - ) - .unwrap(); - - let locales = databake::Bake::bake(LOCALES, &Default::default()); - let cldr_tag = SourceData::LATEST_TESTED_CLDR_TAG; - let icu_tag = SourceData::LATEST_TESTED_ICUEXPORT_TAG; - - metadata - .write_all( - quote::quote! { - pub const LOCALES: &[icu_locid::LanguageIdentifier] = &#locales; - pub const CLDR_TAG: &str = #cldr_tag; - pub const ICUEXPORT_TAG: &str = #icu_tag; - } - .to_string() - .as_bytes(), - ) - .unwrap(); -}