From 6fb141df507ea060360fe20a7f09a0eaaaac1cf5 Mon Sep 17 00:00:00 2001 From: Mikhail Tavarez Date: Sun, 22 Dec 2024 17:02:14 -0600 Subject: [PATCH 1/7] cleanup docstrings --- .github/workflows/build.yml | 13 +- .github/workflows/nightly.yml | 6 +- .github/workflows/test.yml | 8 +- .pre-commit-config.yaml | 6 + magic.lock | 6667 ++++++++++++++++++++++++++++----- mojoproject.toml | 7 +- scripts/examples.sh | 50 - scripts/publish.sh | 6 - scripts/tests.sh | 15 - scripts/util.py | 87 +- src/prism/args.mojo | 29 +- src/prism/command.mojo | 299 +- src/prism/context.mojo | 15 +- src/prism/flag.mojo | 61 +- src/prism/flag_group.mojo | 91 +- src/prism/flag_parser.mojo | 56 +- src/prism/flag_set.mojo | 666 +++- src/prism/util.mojo | 44 +- src/recipe.tmpl | 2 +- test/test_args.mojo | 4 +- test/test_command.mojo | 14 +- test/test_flags.mojo | 2 +- 22 files changed, 6769 insertions(+), 1379 deletions(-) delete mode 100755 scripts/examples.sh delete mode 100644 scripts/publish.sh delete mode 100755 scripts/tests.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0958861..c850462 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,11 @@ -name: Build all packages +name: build on: push: branches: - main paths: - - src/** - -# on: ["push"] + - src/** jobs: build: @@ -29,6 +27,10 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 + - name: Install magic + run: | + curl -ssL https://magic.modular.com | bash + - name: Build package for target platform env: TARGET_PLATFORM: ${{ matrix.target }} @@ -36,15 +38,14 @@ jobs: CONDA_BLD_PATH: ${{ runner.workspace }}/.rattler run: | - curl -ssL https://magic.modular.com | bash source $HOME/.bash_profile - magic self-update --version 0.2.3 # Temporary method to fetch the rattler binary. RATTLER_BINARY="rattler-build-aarch64-apple-darwin" if [[ $TARGET_PLATFORM == "linux-64" ]]; then RATTLER_BINARY="rattler-build-x86_64-unknown-linux-musl"; fi curl -SL --progress-bar https://github.com/prefix-dev/rattler-build/releases/latest/download/${RATTLER_BINARY} -o rattler-build chmod +x rattler-build + export PATH="$PATH:$(pwd)" # Build and push magic run build diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9e274b2..dc068bf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -5,9 +5,7 @@ on: branches: - nightly paths: - - src/** - -# on: ["push"] + - src/** jobs: build: @@ -38,13 +36,13 @@ jobs: run: | curl -ssL https://magic.modular.com | bash source $HOME/.bash_profile - magic self-update --version 0.2.3 # Temporary method to fetch the rattler binary. RATTLER_BINARY="rattler-build-aarch64-apple-darwin" if [[ $TARGET_PLATFORM == "linux-64" ]]; then RATTLER_BINARY="rattler-build-x86_64-unknown-linux-musl"; fi curl -SL --progress-bar https://github.com/prefix-dev/rattler-build/releases/latest/download/${RATTLER_BINARY} -o rattler-build chmod +x rattler-build + export PATH="$PATH:$(pwd)" # Build and push magic run -e nightly build -m nightly diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 73bfa27..21dd34d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Run Tests +name: tests on: pull_request: @@ -14,7 +14,8 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-14"] # mac tests just hang for some reason? + os: ["ubuntu-latest"] + # os: ["ubuntu-latest", "macos-14"] runs-on: ${{ matrix.os }} timeout-minutes: 5 @@ -34,6 +35,5 @@ jobs: - name: Run tests run: | source $HOME/.bash_profile - magic self-update --version 0.2.3 magic run tests - bash scripts/examples.sh + magic run examples diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d8d8c1..adb45c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,3 +13,9 @@ repos: language: system files: '\.(mojo|🔥)$' stages: [commit] + - id: mojo-docs + name: mojo-docs + entry: python3 ./scripts/check-docstrings.py + language: system + pass_filenames: false + stages: [commit] diff --git a/magic.lock b/magic.lock index b8ee6bb..8e7624a 100644 --- a/magic.lock +++ b/magic.lock @@ -9,20 +9,89 @@ environments: linux-64: - conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/aiohappyeyeballs-2.4.4-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aiohttp-3.11.11-py312h178313f_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/aiosignal-1.3.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/annotated-types-0.7.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/anyio-4.7.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/attrs-24.3.0-pyh71513ae_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-auth-0.8.0-hb921021_15.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-cal-0.8.1-h1a47875_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-common-0.10.6-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-compression-0.3.0-h4e1184b_5.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-event-stream-0.5.0-h7959bf6_11.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-http-0.9.2-hefd7a92_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-io-0.15.3-h831e299_5.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-mqtt-0.11.0-h11f4f37_12.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-s3-0.7.7-hf454442_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-c-sdkutils-0.2.1-h4e1184b_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-checksums-0.2.2-h4e1184b_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-crt-cpp-0.29.7-hd92328a_7.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aws-sdk-cpp-1.11.458-hc430e4a_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/azure-core-cpp-1.14.0-h5cfcd09_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/azure-identity-cpp-1.10.0-h113e628_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/azure-storage-blobs-cpp-12.13.0-h3cf044e_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/azure-storage-common-cpp-12.8.0-h736e048_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/azure-storage-files-datalake-cpp-12.12.0-ha633028_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/backoff-2.2.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/brotli-python-1.1.0-py312h2ec8cdc_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-h4bc722e_7.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.34.4-hb9d3cd8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.8.30-hbcca054_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2024.12.14-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cffi-1.17.1-py312h06ac9bb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.0-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.1.7-unix_pyh707e725_0.conda - - conda: https://repo.prefix.dev/mojo-community/linux-64/gojo-0.1.12-hb0f4dca_0.conda - - conda: https://repo.prefix.dev/mojo-community/linux-64/hue-0.1.6-hb0f4dca_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/datasets-2.14.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/deprecated-1.2.15-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dill-0.3.7-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dnspython-2.7.0-pyhff2d567_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/email-validator-2.2.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/email_validator-2.2.0-hd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fastapi-0.115.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fastapi-cli-0.0.5-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.16.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/freetype-2.12.1-h267a509_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/frozenlist-1.5.0-py312h66e93f0_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fsspec-2024.12.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gflags-2.2.2-h5888daf_1005.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/glog-0.7.1-hbabe93e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/googleapis-common-protos-1.66.0-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h11-0.14.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.1.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/httpcore-1.0.7-pyh29332c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/httpx-0.28.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/huggingface_hub-0.26.5-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hyperframe-6.0.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/idna-3.10-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.5.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jinja2-3.1.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.6.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.7.2-pyh31011fe_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.3-h659f571_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lcms2-2.16-hb7c19ff_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.43-h712a8e2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lerc-4.0.0-h27087fc_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/libabseil-20240722.0-cxx17_h5888daf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libarrow-18.1.0-h44a453e_6_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libarrow-acero-18.1.0-hcb10f89_6_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libarrow-dataset-18.1.0-hcb10f89_6_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libarrow-substrait-18.1.0-h3ee7192_6_cpu.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-25_linux64_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.1.0-hb9d3cd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.1.0-hb9d3cd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.1.0-hb9d3cd8_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-25_linux64_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcrc32c-1.1.2-h9c3ff4c_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.11.1-h332b0f4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.23-h4ddbbb0_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libevent-2.1.12-hf998b51_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.3-h5888daf_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda @@ -31,96 +100,333 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-14.2.0-h69a702a_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-14.2.0-hd5240d6_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgoogle-cloud-2.32.0-h804f50b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgoogle-cloud-storage-2.32.0-h0121fbd_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgrpc-1.67.1-hc2c308b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.0.0-hd590300_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-25_linux64_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.6.3-hb9d3cd8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.64.0-h161d5f1_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.28-pthreads_h94d23a6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libparquet-18.1.0-h081d1f1_6_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.44-hadc24fc_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libprotobuf-5.28.2-h5b01275_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libre2-11-2024.07.02-hbbce691_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libsodium-1.0.20-h4ab18f5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.47.0-hadc24fc_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.1-hf672d98_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-14.2.0-hc0a3c3a_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.2.0-h4852527_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libthrift-0.21.0-h0e7cc3e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.7.0-hd9ff511_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libutf8proc-2.9.0-hb9d3cd8_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.5.0-h851e524_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.17.0-h8a09558_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.13.5-h0d44e9d_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda - - conda: https://conda.modular.com/max/noarch/max-24.5.0-release.conda - - conda: https://conda.modular.com/max/linux-64/max-core-24.5.0-release.conda - - conda: https://conda.modular.com/max/linux-64/max-python-24.5.0-3.12release.conda - - conda: https://conda.modular.com/max/noarch/mblack-24.5.0-release.conda - - conda: https://repo.prefix.dev/mojo-community/linux-64/mist-0.1.8-hb0f4dca_0.conda - - conda: https://repo.prefix.dev/mojo-community/linux-64/mog-0.1.6-hb0f4dca_0.conda - - conda: https://conda.modular.com/max/noarch/mojo-jupyter-24.5.0-release.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lz4-c-1.10.0-h5888daf_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-3.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/markupsafe-3.0.2-py312h178313f_1.conda + - conda: https://conda.modular.com/max/noarch/max-24.6.0-release.conda + - conda: https://conda.modular.com/max/linux-64/max-core-24.6.0-release.conda + - conda: https://conda.modular.com/max/linux-64/max-python-24.6.0-3.12release.conda + - conda: https://conda.modular.com/max/noarch/mblack-24.6.0-release.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdurl-0.1.2-pyhd8ed1ab_1.conda + - conda: https://repo.prefix.dev/mojo-community/linux-64/mist-0.1.10-hb0f4dca_0.conda + - conda: https://repo.prefix.dev/mojo-community/linux-64/mog-0.1.7-hb0f4dca_0.conda + - conda: https://conda.modular.com/max/noarch/mojo-jupyter-24.6.0-release.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/multidict-6.1.0-py312h178313f_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/multiprocess-0.70.15-py312h98912ed_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/mypy_extensions-1.0.0-pyha770c72_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-1.26.4-py312heda63a1_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.2-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openjpeg-2.5.3-h5fbd93e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.4.0-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-api-1.29.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-otlp-proto-common-1.29.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-otlp-proto-http-1.29.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-prometheus-1.12.0rc1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-proto-1.29.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-sdk-1.29.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-semantic-conventions-0.50b0-pyh3cfb1c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/orc-2.0.3-h97ab989_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pandas-2.2.3-py312hf9745cd_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pathspec-0.12.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pillow-11.0.0-py312h7b63e92_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.3.6-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prometheus_client-0.21.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/propcache-0.2.1-py312h66e93f0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/protobuf-5.28.2-py312h2ec8cdc_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-hb9d3cd8_1002.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyarrow-18.1.0-py312h7900ff3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyarrow-core-18.1.0-py312h01725c0_0_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pydantic-2.10.4-pyh3cfb1c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pydantic-core-2.27.2-py312h12e396e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pydantic-settings-2.7.0-pyh3cfb1c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.18.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyinstrument-5.0.0-py312h66e93f0_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pysocks-1.7.1-pyha55dd90_7.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.7-hc5c86c4_0_cpython.conda - conda: https://conda.anaconda.org/conda-forge/noarch/python-dateutil-2.9.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-dotenv-1.0.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-json-logger-2.0.7-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-multipart-0.0.20-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-tzdata-2024.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-xxhash-3.5.0-py312h66e93f0_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.12-5_cp312.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytz-2024.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.2-py312h66e93f0_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pyzmq-26.2.0-py312hbf22597_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/re2-2024.07.02-h77b4e00_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8228510_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/regex-2024.11.6-py312h66e93f0_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/requests-2.32.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/rich-13.9.4-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/s2n-1.5.10-hb5b8611_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/safetensors-0.4.5-py312h12e396e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/shellingham-1.5.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/snappy-1.2.1-h8bd8927_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sniffio-1.3.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sse-starlette-2.2.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/starlette-0.41.3-pyha770c72_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tokenizers-0.21.0-py312h8360d73_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/tornado-6.4.1-py312h66e93f0_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/transformers-4.47.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.1-hd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.12.2-hd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda - - conda: https://repo.prefix.dev/mojo-community/linux-64/weave-0.1.2-hb0f4dca_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.3.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/uvicorn-0.34.0-pyh31011fe_0.conda + - conda: https://repo.prefix.dev/mojo-community/linux-64/weave-0.1.3-hb0f4dca_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/wrapt-1.17.0-py312h66e93f0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.12-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.5-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xxhash-0.8.2-hd590300_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h7f98852_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/yarl-1.18.3-py312h66e93f0_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/zeromq-4.3.5-h3b0a872_6.conda - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.20.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstandard-0.23.0-py312hef9b889_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda osx-arm64: + - conda: https://conda.anaconda.org/conda-forge/noarch/aiohappyeyeballs-2.4.4-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aiohttp-3.11.11-py312h998013c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/aiosignal-1.3.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/annotated-types-0.7.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/anyio-4.7.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/attrs-24.3.0-pyh71513ae_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-auth-0.8.0-h6935006_7.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-cal-0.8.0-h8a8b6a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-common-0.10.0-h7ab814d_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-compression-0.3.0-h8a8b6a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-event-stream-0.5.0-h53a7d5e_4.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-http-0.9.0-h007639a_5.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-io-0.15.1-hb495e35_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-mqtt-0.11.0-h6850007_5.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-s3-0.7.0-h2bee52d_7.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-sdkutils-0.2.1-h0b63f77_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-checksums-0.2.0-h8a8b6a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-crt-cpp-0.29.3-h7abc90e_2.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/aws-sdk-cpp-1.11.407-h124cfea_9.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/azure-core-cpp-1.14.0-hd50102c_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/azure-identity-cpp-1.10.0-hc602bab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/azure-storage-blobs-cpp-12.13.0-h7585a09_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/azure-storage-common-cpp-12.8.0-h9ca1f76_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/azure-storage-files-datalake-cpp-12.12.0-hcdd55da_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/backoff-2.2.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/brotli-python-1.1.0-py312hde4cb15_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-h99b78c6_7.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/c-ares-1.34.4-h5505292_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ca-certificates-2024.8.30-hf0a4a13_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2024.12.14-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/cffi-1.17.1-py312h0fad829_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.0-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.1.7-unix_pyh707e725_0.conda - - conda: https://repo.prefix.dev/mojo-community/osx-arm64/gojo-0.1.13-h60d57d3_0.conda - - conda: https://repo.prefix.dev/mojo-community/osx-arm64/hue-0.1.6-h60d57d3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/datasets-2.14.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/deprecated-1.2.15-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dill-0.3.7-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dnspython-2.7.0-pyhff2d567_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/email-validator-2.2.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/email_validator-2.2.0-hd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fastapi-0.115.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fastapi-cli-0.0.5-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.16.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/freetype-2.12.1-hadb7bae_2.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/frozenlist-1.5.0-py312h0bf5046_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fsspec-2024.12.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/gflags-2.2.2-hf9b8971_1005.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/glog-0.7.1-heb240a5_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/googleapis-common-protos-1.66.0-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h11-0.14.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.1.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/httpcore-1.0.7-pyh29332c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/httpx-0.28.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/huggingface_hub-0.26.5-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hyperframe-6.0.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/icu-75.1-hfee45f7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/idna-3.10-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.5.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jinja2-3.1.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.6.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.7.2-pyh31011fe_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/krb5-1.21.3-h237132a_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/lcms2-2.16-ha0e7c42_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/lerc-4.0.0-h9a09cb3_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libabseil-20240722.0-cxx17_hf9b8971_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libarrow-18.0.0-h445c139_4_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libarrow-acero-18.0.0-h286801f_4_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libarrow-dataset-18.0.0-h286801f_4_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libarrow-substrait-18.0.0-h6a6e5c5_4_cpu.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libblas-3.9.0-25_osxarm64_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libbrotlicommon-1.1.0-hd74edd7_2.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libbrotlidec-1.1.0-hd74edd7_2.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libbrotlienc-1.1.0-hd74edd7_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcblas-3.9.0-25_osxarm64_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcrc32c-1.1.2-hbdafb3b_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcurl-8.10.1-h13a7ad3_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcxx-19.1.3-ha82da77_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libdeflate-1.23-hec38601_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libedit-3.1.20191231-hc8eb9b7_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libev-4.33-h93a5062_2.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libevent-2.1.12-h2757513_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libexpat-2.6.3-hf9b8971_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.4.2-h3422bc3_5.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libgfortran-5.0.0-13_2_0_hd922786_3.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libgfortran5-13.2.0-hf226fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libgoogle-cloud-2.31.0-h8d8be31_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libgoogle-cloud-storage-2.31.0-h7081f7f_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libgrpc-1.67.1-hc70892a_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libiconv-1.17-h0d3ecfb_2.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libjpeg-turbo-3.0.0-hb547adb_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/liblapack-3.9.0-25_osxarm64_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/liblzma-5.6.3-h39f12f2_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libnghttp2-1.64.0-h6d7220d_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libopenblas-0.3.28-openmp_h517c56d_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libparquet-18.0.0-hda0ea68_4_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libpng-1.6.44-hc14010f_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libprotobuf-5.28.2-h8f0b736_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libre2-11-2024.07.02-h2348fd5_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libsodium-1.0.20-h99b78c6_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.47.0-hbaaea75_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libssh2-1.11.0-h7a5bd25_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libthrift-0.21.0-h64651cc_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libtiff-4.7.0-h551f018_3.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libutf8proc-2.8.0-hc098a78_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libwebp-base-1.5.0-h2471fea_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libxcb-1.17.0-hdb1d25a_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libxml2-2.13.5-h178c5d8_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.3.1-h8359307_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-19.1.3-hb52a8e5_0.conda - - conda: https://conda.modular.com/max/noarch/max-24.5.0-release.conda - - conda: https://conda.modular.com/max/osx-arm64/max-core-24.5.0-release.conda - - conda: https://conda.modular.com/max/osx-arm64/max-python-24.5.0-3.12release.conda - - conda: https://conda.modular.com/max/noarch/mblack-24.5.0-release.conda - - conda: https://repo.prefix.dev/mojo-community/osx-arm64/mist-0.1.8-h60d57d3_0.conda - - conda: https://repo.prefix.dev/mojo-community/osx-arm64/mog-0.1.6-h60d57d3_0.conda - - conda: https://conda.modular.com/max/noarch/mojo-jupyter-24.5.0-release.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/lz4-c-1.9.4-hb7217d7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-3.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/markupsafe-3.0.2-py312h998013c_1.conda + - conda: https://conda.modular.com/max/noarch/max-24.6.0-release.conda + - conda: https://conda.modular.com/max/osx-arm64/max-core-24.6.0-release.conda + - conda: https://conda.modular.com/max/osx-arm64/max-python-24.6.0-3.12release.conda + - conda: https://conda.modular.com/max/noarch/mblack-24.6.0-release.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdurl-0.1.2-pyhd8ed1ab_1.conda + - conda: https://repo.prefix.dev/mojo-community/osx-arm64/mist-0.1.10-h60d57d3_0.conda + - conda: https://repo.prefix.dev/mojo-community/osx-arm64/mog-0.1.7-h60d57d3_0.conda + - conda: https://conda.modular.com/max/noarch/mojo-jupyter-24.6.0-release.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/multidict-6.1.0-py312hdb8e49c_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/multiprocess-0.70.15-py312h02f2b3b_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/mypy_extensions-1.0.0-pyha770c72_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.5-h7bae524_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/numpy-1.26.4-py312h8442bc7_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/openjpeg-2.5.3-h8a3d83b_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.3.2-h8359307_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-api-1.29.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-otlp-proto-common-1.29.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-otlp-proto-http-1.29.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-prometheus-1.12.0rc1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-proto-1.29.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-sdk-1.29.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-semantic-conventions-0.50b0-pyh3cfb1c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/orc-2.0.2-hcb3c8b3_2.conda - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pandas-2.2.3-py312hcd31e36_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pathspec-0.12.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pillow-11.0.0-py312haf37ca6_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.3.6-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prometheus_client-0.21.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/propcache-0.2.1-py312hea69d52_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/protobuf-5.28.2-py312hf02c72a_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pthread-stubs-0.4-hd74edd7_1002.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pyarrow-18.0.0-py312h1f38498_2.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pyarrow-core-18.0.0-py312hc40f475_2_cpu.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pydantic-2.10.4-pyh3cfb1c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pydantic-core-2.27.2-py312hcd83bfe_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pydantic-settings-2.7.0-pyh3cfb1c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.18.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pyinstrument-5.0.0-py312h0bf5046_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pysocks-1.7.1-pyha55dd90_7.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/python-3.12.7-h739c21a_0_cpython.conda - conda: https://conda.anaconda.org/conda-forge/noarch/python-dateutil-2.9.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-dotenv-1.0.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-json-logger-2.0.7-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-multipart-0.0.20-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-tzdata-2024.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/python-xxhash-3.5.0-py312h024a12e_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/python_abi-3.12-5_cp312.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytz-2024.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pyyaml-6.0.2-py312h024a12e_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pyzmq-26.2.0-py312hf8a1cbd_3.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/re2-2024.07.02-hcd0e937_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/readline-8.2-h92ec313_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/regex-2024.11.6-py312hea69d52_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/requests-2.32.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/rich-13.9.4-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/safetensors-0.4.5-py312he431725_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/shellingham-1.5.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/snappy-1.2.1-h98b9ce2_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sniffio-1.3.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sse-starlette-2.2.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/starlette-0.41.3-pyha770c72_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tk-8.6.13-h5083fa2_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tokenizers-0.21.0-py312hf3e4074_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tornado-6.4.1-py312h024a12e_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/transformers-4.47.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.1-hd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.12.2-hd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda - - conda: https://repo.prefix.dev/mojo-community/osx-arm64/weave-0.1.2-h60d57d3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.3.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/uvicorn-0.34.0-pyh31011fe_0.conda + - conda: https://repo.prefix.dev/mojo-community/osx-arm64/weave-0.1.3-h60d57d3_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/wrapt-1.17.0-py312hea69d52_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xorg-libxau-1.0.12-h5505292_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xorg-libxdmcp-1.1.5-hd74edd7_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xxhash-0.8.2-hb547adb_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xz-5.2.6-h57fd34a_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/yaml-0.2.5-h3422bc3_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/yarl-1.18.3-py312hea69d52_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/zeromq-4.3.5-h9f5b81c_6.conda - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.20.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/zstandard-0.23.0-py312h15fbf35_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/zstd-1.5.6-hb46c0d2_0.conda packages: - kind: conda name: _libgcc_mutex @@ -152,1169 +458,4734 @@ packages: size: 23621 timestamp: 1650670423406 - kind: conda - name: bzip2 - version: 1.0.8 - build: h4bc722e_7 - build_number: 7 + name: aiohappyeyeballs + version: 2.4.4 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/aiohappyeyeballs-2.4.4-pyhd8ed1ab_1.conda + sha256: 95d4713e49ea92ae50cf42393683ede706b7875af5f7cb14c253438180afa732 + md5: 296b403617bafa89df4971567af79013 + depends: + - python >=3.9 + license: PSF-2.0 + license_family: PSF + size: 19351 + timestamp: 1733332029649 +- kind: conda + name: aiohttp + version: 3.11.11 + build: py312h178313f_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-h4bc722e_7.conda - sha256: 5ced96500d945fb286c9c838e54fa759aa04a7129c59800f0846b4335cee770d - md5: 62ee74e96c5ebb0af99386de58cf9553 + url: https://conda.anaconda.org/conda-forge/linux-64/aiohttp-3.11.11-py312h178313f_0.conda + sha256: 2e817805e8a4fed33f23f116ff5649f8651af693328e9ed82d9d11a951338693 + md5: 8219afa093757bbe07b9825eb1973ed9 depends: - __glibc >=2.17,<3.0.a0 - - libgcc-ng >=12 - license: bzip2-1.0.6 - license_family: BSD - size: 252783 - timestamp: 1720974456583 + - aiohappyeyeballs >=2.3.0 + - aiosignal >=1.1.2 + - attrs >=17.3.0 + - frozenlist >=1.1.1 + - libgcc >=13 + - multidict >=4.5,<7.0 + - propcache >=0.2.0 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - yarl >=1.17.0,<2.0 + license: MIT AND Apache-2.0 + license_family: Apache + size: 915358 + timestamp: 1734597073870 - kind: conda - name: bzip2 - version: 1.0.8 - build: h99b78c6_7 - build_number: 7 + name: aiohttp + version: 3.11.11 + build: py312h998013c_0 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-h99b78c6_7.conda - sha256: adfa71f158cbd872a36394c56c3568e6034aa55c623634b37a4836bd036e6b91 - md5: fc6948412dbbbe9a4c9ddbbcfe0a79ab + url: https://conda.anaconda.org/conda-forge/osx-arm64/aiohttp-3.11.11-py312h998013c_0.conda + sha256: 446f078e7a7b892894d7f4851a278b7834ffb4f5632313646a55c3abe13690d4 + md5: c69c904691364cfb27d15aa7153e9c29 depends: - __osx >=11.0 - license: bzip2-1.0.6 - license_family: BSD - size: 122909 - timestamp: 1720974522888 -- kind: conda - name: ca-certificates - version: 2024.8.30 - build: hbcca054_0 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.8.30-hbcca054_0.conda - sha256: afee721baa6d988e27fef1832f68d6f32ac8cc99cdf6015732224c2841a09cea - md5: c27d1c142233b5bc9ca570c6e2e0c244 - license: ISC - size: 159003 - timestamp: 1725018903918 -- kind: conda - name: ca-certificates - version: 2024.8.30 - build: hf0a4a13_0 - subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/ca-certificates-2024.8.30-hf0a4a13_0.conda - sha256: 2db1733f4b644575dbbdd7994a8f338e6ef937f5ebdb74acd557e9dda0211709 - md5: 40dec13fd8348dbe303e57be74bd3d35 - license: ISC - size: 158482 - timestamp: 1725019034582 + - aiohappyeyeballs >=2.3.0 + - aiosignal >=1.1.2 + - attrs >=17.3.0 + - frozenlist >=1.1.1 + - multidict >=4.5,<7.0 + - propcache >=0.2.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + - yarl >=1.17.0,<2.0 + license: MIT AND Apache-2.0 + license_family: Apache + size: 875711 + timestamp: 1734597277258 - kind: conda - name: click - version: 8.1.7 - build: unix_pyh707e725_0 + name: aiosignal + version: 1.3.2 + build: pyhd8ed1ab_0 subdir: noarch noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/click-8.1.7-unix_pyh707e725_0.conda - sha256: f0016cbab6ac4138a429e28dbcb904a90305b34b3fe41a9b89d697c90401caec - md5: f3ad426304898027fc619827ff428eca - depends: - - __unix - - python >=3.8 - license: BSD-3-Clause - license_family: BSD - size: 84437 - timestamp: 1692311973840 -- kind: conda - name: gojo - version: 0.1.12 - build: hb0f4dca_0 - subdir: linux-64 - url: https://repo.prefix.dev/mojo-community/linux-64/gojo-0.1.12-hb0f4dca_0.conda - sha256: 3ca6c2960b534dde013badc7c8e0e1e9c5f03818440e11ecdf584bd3ed1dc5f1 + url: https://conda.anaconda.org/conda-forge/noarch/aiosignal-1.3.2-pyhd8ed1ab_0.conda + sha256: 7de8ced1918bbdadecf8e1c1c68237fe5709c097bd9e0d254f4cad118f4345d0 + md5: 1a3981115a398535dbe3f6d5faae3d36 depends: - - max >=24.5.0,<24.6.0 - arch: x86_64 - platform: linux - license: MIT - size: 1012037 - timestamp: 1727015683335 + - frozenlist >=1.1.0 + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 13229 + timestamp: 1734342253061 - kind: conda - name: gojo - version: 0.1.13 - build: h60d57d3_0 - subdir: osx-arm64 - url: https://repo.prefix.dev/mojo-community/osx-arm64/gojo-0.1.13-h60d57d3_0.conda - sha256: 06475a69ac426781b628a3aefcf115dc8e7df0064637a04d6d039031a6e539f7 + name: annotated-types + version: 0.7.0 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/annotated-types-0.7.0-pyhd8ed1ab_1.conda + sha256: e0ea1ba78fbb64f17062601edda82097fcf815012cf52bb704150a2668110d48 + md5: 2934f256a8acfe48f6ebb4fce6cde29c depends: - - max >=24.5.0,<25 - arch: arm64 - platform: osx + - python >=3.9 + - typing-extensions >=4.0.0 license: MIT - size: 999737 - timestamp: 1728268347402 + license_family: MIT + size: 18074 + timestamp: 1733247158254 - kind: conda - name: hue - version: 0.1.6 - build: h60d57d3_0 - subdir: osx-arm64 - url: https://repo.prefix.dev/mojo-community/osx-arm64/hue-0.1.6-h60d57d3_0.conda - sha256: 51c94dd89dd859f705be4da9c825b63dd953898ab61d7089a1160fadaf2b1dff + name: anyio + version: 4.7.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/anyio-4.7.0-pyhd8ed1ab_0.conda + sha256: 687537ee3af30f8784986bf40cac30e88138770b16e51ca9850c9c23c09aeba1 + md5: c88107912954a983c2caf25f7fd55158 depends: - - max >=24.5.0,<25 - arch: arm64 - platform: osx + - exceptiongroup >=1.0.2 + - idna >=2.8 + - python >=3.9 + - sniffio >=1.1 + - typing_extensions >=4.5 + constrains: + - trio >=0.26.1 + - uvloop >=0.21 license: MIT - size: 486980 - timestamp: 1726620535591 + license_family: MIT + size: 112730 + timestamp: 1733532678437 - kind: conda - name: hue - version: 0.1.6 - build: hb0f4dca_0 - subdir: linux-64 - url: https://repo.prefix.dev/mojo-community/linux-64/hue-0.1.6-hb0f4dca_0.conda - sha256: 25b1a8573d431c2f1077b6322ef77eeeec1f1a0c9d868829a3734f3072a384f8 + name: attrs + version: 24.3.0 + build: pyh71513ae_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/attrs-24.3.0-pyh71513ae_0.conda + sha256: 750186af694a7130eaf7119fbb56db0d2326d8995ad5b8eae23c622b85fea29a + md5: 356927ace43302bf6f5926e2a58dae6a depends: - - max >=24.5.0,<25 - arch: x86_64 - platform: linux + - python >=3.9 license: MIT - size: 486916 - timestamp: 1726620530331 + license_family: MIT + size: 56354 + timestamp: 1734348889193 - kind: conda - name: importlib-metadata - version: 8.5.0 - build: pyha770c72_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.5.0-pyha770c72_0.conda - sha256: 7194700ce1a5ad2621fd68e894dd8c1ceaff9a38723e6e0e5298fdef13017b1c - md5: 54198435fce4d64d8a89af22573012a8 + name: aws-c-auth + version: 0.8.0 + build: h6935006_7 + build_number: 7 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-auth-0.8.0-h6935006_7.conda + sha256: 1b2d103607232935425565d929eb704924f72c41abbf7ad55ccbaa7a4c4ef832 + md5: c1181b45af5bb8867ee9edf2e85ecc91 depends: - - python >=3.8 - - zipp >=0.5 + - __osx >=11.0 + - aws-c-cal >=0.8.0,<0.8.1.0a0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + - aws-c-http >=0.9.0,<0.9.1.0a0 + - aws-c-io >=0.15.1,<0.15.2.0a0 + - aws-c-sdkutils >=0.2.1,<0.2.2.0a0 license: Apache-2.0 - license_family: APACHE - size: 28646 - timestamp: 1726082927916 + license_family: Apache + size: 92307 + timestamp: 1731097803566 - kind: conda - name: jupyter_client - version: 8.6.3 - build: pyhd8ed1ab_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.6.3-pyhd8ed1ab_0.conda - sha256: 4419c85e209a715f551a5c9bead746f29ee9d0fc41e772a76db3868622795671 - md5: a14218cfb29662b4a19ceb04e93e298e + name: aws-c-auth + version: 0.8.0 + build: hb921021_15 + build_number: 15 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-auth-0.8.0-hb921021_15.conda + sha256: 537006ad6d5097c134494166a6a1dc1451d5d050878d7b82cef498bfda40ba8a + md5: c79d50f64cffa5ad51ecc1a81057962f depends: - - importlib-metadata >=4.8.3 - - jupyter_core >=4.12,!=5.0.* - - python >=3.8 - - python-dateutil >=2.8.2 - - pyzmq >=23.0 - - tornado >=6.2 - - traitlets >=5.3 - license: BSD-3-Clause - license_family: BSD - size: 106055 - timestamp: 1726610805505 + - __glibc >=2.17,<3.0.a0 + - aws-c-cal >=0.8.1,<0.8.2.0a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - aws-c-http >=0.9.2,<0.9.3.0a0 + - aws-c-io >=0.15.3,<0.15.4.0a0 + - aws-c-sdkutils >=0.2.1,<0.2.2.0a0 + - libgcc >=13 + license: Apache-2.0 + license_family: Apache + size: 107614 + timestamp: 1734021692519 - kind: conda - name: jupyter_core - version: 5.7.2 - build: pyh31011fe_1 + name: aws-c-cal + version: 0.8.0 + build: h8a8b6a7_1 build_number: 1 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.7.2-pyh31011fe_1.conda - sha256: 732b1e8536bc22a5a174baa79842d79db2f4956d90293dd82dc1b3f6099bcccd - md5: 0a2980dada0dd7fd0998f0342308b1b1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-cal-0.8.0-h8a8b6a7_1.conda + sha256: 0f8ad4bd6067ca35ef89834b8f11ed391bec122afa4f4df2c087b7c2934c4743 + md5: 107fcd20e67df3945a34129098f3da4a depends: - - __unix - - platformdirs >=2.5 - - python >=3.8 - - traitlets >=5.3 - license: BSD-3-Clause - license_family: BSD - size: 57671 - timestamp: 1727163547058 + - __osx >=11.0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + - openssl >=3.3.1,<4.0a0 + license: Apache-2.0 + license_family: Apache + size: 39786 + timestamp: 1729804027907 - kind: conda - name: keyutils - version: 1.6.1 - build: h166bdaf_0 + name: aws-c-cal + version: 0.8.1 + build: h1a47875_3 + build_number: 3 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 - sha256: 150c05a6e538610ca7c43beb3a40d65c90537497a4f6a5f4d15ec0451b6f5ebb - md5: 30186d27e2c9fa62b45fb1476b7200e3 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-cal-0.8.1-h1a47875_3.conda + sha256: 095ac824ea9303eff67e04090ae531d9eb33d2bf8f82eaade39b839c421e16e8 + md5: 55a8561fdbbbd34f50f57d9be12ed084 depends: - - libgcc-ng >=10.3.0 - license: LGPL-2.1-or-later - size: 117831 - timestamp: 1646151697040 + - __glibc >=2.17,<3.0.a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - libgcc >=13 + - openssl >=3.3.1,<4.0a0 + license: Apache-2.0 + license_family: Apache + size: 47601 + timestamp: 1733991564405 - kind: conda - name: krb5 - version: 1.21.3 - build: h237132a_0 + name: aws-c-common + version: 0.10.0 + build: h7ab814d_0 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/krb5-1.21.3-h237132a_0.conda - sha256: 4442f957c3c77d69d9da3521268cad5d54c9033f1a73f99cde0a3658937b159b - md5: c6dc8a0fdec13a0565936655c33069a1 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-common-0.10.0-h7ab814d_0.conda + sha256: 4ac33b0ec0d8a3b8af462d51e0e5e9095d9726860eb9b711ab6c6f84ba6b6b5e + md5: d4a98098dac19b54459855c1eb4a689a depends: - __osx >=11.0 - - libcxx >=16 - - libedit >=3.1.20191231,<3.2.0a0 - - libedit >=3.1.20191231,<4.0a0 - - openssl >=3.3.1,<4.0a0 - license: MIT - license_family: MIT - size: 1155530 - timestamp: 1719463474401 + license: Apache-2.0 + license_family: Apache + size: 220758 + timestamp: 1729771231483 - kind: conda - name: krb5 - version: 1.21.3 - build: h659f571_0 + name: aws-c-common + version: 0.10.6 + build: hb9d3cd8_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.3-h659f571_0.conda - sha256: 99df692f7a8a5c27cd14b5fb1374ee55e756631b9c3d659ed3ee60830249b238 - md5: 3f43953b7d3fb3aaa1d0d0723d91e368 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-common-0.10.6-hb9d3cd8_0.conda + sha256: 496e92f2150fdc351eacf6e236015deedb3d0d3114f8e5954341cbf9f3dda257 + md5: d7d4680337a14001b0e043e96529409b depends: - - keyutils >=1.6.1,<2.0a0 - - libedit >=3.1.20191231,<3.2.0a0 - - libedit >=3.1.20191231,<4.0a0 - - libgcc-ng >=12 - - libstdcxx-ng >=12 - - openssl >=3.3.1,<4.0a0 - license: MIT - license_family: MIT - size: 1370023 - timestamp: 1719463201255 + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: Apache-2.0 + license_family: Apache + size: 236574 + timestamp: 1733975453350 - kind: conda - name: ld_impl_linux-64 - version: '2.43' - build: h712a8e2_2 - build_number: 2 + name: aws-c-compression + version: 0.3.0 + build: h4e1184b_5 + build_number: 5 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.43-h712a8e2_2.conda - sha256: 7c91cea91b13f4314d125d1bedb9d03a29ebbd5080ccdea70260363424646dbe - md5: 048b02e3962f066da18efe3a21b77672 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-compression-0.3.0-h4e1184b_5.conda + sha256: 62ca84da83585e7814a40240a1e750b1563b2680b032a471464eccc001c3309b + md5: 3f4c1197462a6df2be6dc8241828fe93 depends: - __glibc >=2.17,<3.0.a0 - constrains: - - binutils_impl_linux-64 2.43 - license: GPL-3.0-only - license_family: GPL - size: 669211 - timestamp: 1729655358674 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - libgcc >=13 + license: Apache-2.0 + license_family: Apache + size: 19086 + timestamp: 1733991637424 - kind: conda - name: libblas - version: 3.9.0 - build: 25_linux64_openblas - build_number: 25 + name: aws-c-compression + version: 0.3.0 + build: h8a8b6a7_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-compression-0.3.0-h8a8b6a7_1.conda + sha256: 701d2b269ce3d58f298d79a76e4a6537b2b9df32745584a3d012253dc49dd9d9 + md5: e3306612c4561cbea6d0216b3dd85338 + depends: + - __osx >=11.0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + license: Apache-2.0 + license_family: Apache + size: 18131 + timestamp: 1730809780125 +- kind: conda + name: aws-c-event-stream + version: 0.5.0 + build: h53a7d5e_4 + build_number: 4 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-event-stream-0.5.0-h53a7d5e_4.conda + sha256: c0302836312b1755d47cd9a6dac6de21a98846a9a23d0208d772f450942e0c0e + md5: ee6ab18e57b915a8680bbbc583c04f0b + depends: + - __osx >=11.0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + - aws-c-io >=0.15.1,<0.15.2.0a0 + - aws-checksums >=0.2.0,<0.2.1.0a0 + - libcxx >=18 + license: Apache-2.0 + license_family: Apache + size: 47154 + timestamp: 1730808738644 +- kind: conda + name: aws-c-event-stream + version: 0.5.0 + build: h7959bf6_11 + build_number: 11 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-25_linux64_openblas.conda - sha256: d6d12dc437d060f838820e9e61bf73baab651f91935ac594cf10beb9ef1b4450 - md5: 8ea26d42ca88ec5258802715fe1ee10b + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-event-stream-0.5.0-h7959bf6_11.conda + sha256: 10d7240c7db0c941fb1a59c4f8ea6689a434b03309ee7b766fa15a809c553c02 + md5: 9b3fb60fe57925a92f399bc3fc42eccf depends: - - libopenblas >=0.3.28,<0.3.29.0a0 - - libopenblas >=0.3.28,<1.0a0 - constrains: - - liblapack 3.9.0 25_linux64_openblas - - libcblas 3.9.0 25_linux64_openblas - - blas * openblas - - liblapacke 3.9.0 25_linux64_openblas - license: BSD-3-Clause - license_family: BSD - size: 15677 - timestamp: 1729642900350 + - __glibc >=2.17,<3.0.a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - aws-c-io >=0.15.3,<0.15.4.0a0 + - aws-checksums >=0.2.2,<0.2.3.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: Apache-2.0 + license_family: Apache + size: 54003 + timestamp: 1734024480949 - kind: conda - name: libblas - version: 3.9.0 - build: 25_osxarm64_openblas - build_number: 25 + name: aws-c-http + version: 0.9.0 + build: h007639a_5 + build_number: 5 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libblas-3.9.0-25_osxarm64_openblas.conda - sha256: f1fb9a11af0b2878bd8804b4c77d3733c40076218bcbdb35f575b1c0c9fddf11 - md5: f8cf4d920ff36ce471619010eff59cac + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-http-0.9.0-h007639a_5.conda + sha256: 50e506e55e491c1560324e73de001af21dcdbd1c5c4d2a46984588fb87813ecc + md5: e8be780c203c54a620f70dd2b15263ce depends: - - libopenblas >=0.3.28,<0.3.29.0a0 - - libopenblas >=0.3.28,<1.0a0 - constrains: - - blas * openblas - - liblapack 3.9.0 25_osxarm64_openblas - - liblapacke 3.9.0 25_osxarm64_openblas - - libcblas 3.9.0 25_osxarm64_openblas - license: BSD-3-Clause - license_family: BSD - size: 15913 - timestamp: 1729643265495 + - __osx >=11.0 + - aws-c-cal >=0.8.0,<0.8.1.0a0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + - aws-c-compression >=0.3.0,<0.3.1.0a0 + - aws-c-io >=0.15.1,<0.15.2.0a0 + license: Apache-2.0 + license_family: Apache + size: 152818 + timestamp: 1730828839775 - kind: conda - name: libcblas - version: 3.9.0 - build: 25_linux64_openblas - build_number: 25 + name: aws-c-http + version: 0.9.2 + build: hefd7a92_4 + build_number: 4 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-25_linux64_openblas.conda - sha256: ab87b0477078837c91d9cda62a9faca18fba7c57cc77aa779ae24b3ac783b5dd - md5: 5dbd1b0fc0d01ec5e0e1fbe667281a11 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-http-0.9.2-hefd7a92_4.conda + sha256: 4a330206bd51148f6c13ca0b7a4db40f29a46f090642ebacdeb88b8a4abd7f99 + md5: 5ce4df662d32d3123ea8da15571b6f51 depends: - - libblas 3.9.0 25_linux64_openblas - constrains: - - liblapack 3.9.0 25_linux64_openblas - - blas * openblas - - liblapacke 3.9.0 25_linux64_openblas - license: BSD-3-Clause - license_family: BSD - size: 15613 - timestamp: 1729642905619 + - __glibc >=2.17,<3.0.a0 + - aws-c-cal >=0.8.1,<0.8.2.0a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - aws-c-compression >=0.3.0,<0.3.1.0a0 + - aws-c-io >=0.15.3,<0.15.4.0a0 + - libgcc >=13 + license: Apache-2.0 + license_family: Apache + size: 197731 + timestamp: 1734008380764 - kind: conda - name: libcblas - version: 3.9.0 - build: 25_osxarm64_openblas - build_number: 25 + name: aws-c-io + version: 0.15.1 + build: hb495e35_1 + build_number: 1 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libcblas-3.9.0-25_osxarm64_openblas.conda - sha256: d9fa5b6b11252132a3383bbf87bd2f1b9d6248bef1b7e113c2a8ae41b0376218 - md5: 4df0fae81f0b5bf47d48c882b086da11 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-io-0.15.1-hb495e35_1.conda + sha256: 3dabe80b2fe7965e05debcb6e28a622e95c411a37d2695b9a09bec612307337d + md5: d6d283e3ba890b8386b54ca8f571f616 depends: - - libblas 3.9.0 25_osxarm64_openblas - constrains: - - blas * openblas - - liblapack 3.9.0 25_osxarm64_openblas - - liblapacke 3.9.0 25_osxarm64_openblas - license: BSD-3-Clause - license_family: BSD - size: 15837 - timestamp: 1729643270793 + - __osx >=11.0 + - aws-c-cal >=0.8.0,<0.8.1.0a0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + license: Apache-2.0 + license_family: Apache + size: 137660 + timestamp: 1730847405147 - kind: conda - name: libcxx - version: 19.1.3 - build: ha82da77_0 + name: aws-c-io + version: 0.15.3 + build: h831e299_5 + build_number: 5 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-io-0.15.3-h831e299_5.conda + sha256: 5920009b1c6f9a2bc131a36725251894e4b4773fce29c4b1065d4213ae337abe + md5: 80dd9f0ddf935290d1dc00ec75ff3023 + depends: + - __glibc >=2.17,<3.0.a0 + - aws-c-cal >=0.8.1,<0.8.2.0a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - libgcc >=13 + - s2n >=1.5.10,<1.5.11.0a0 + license: Apache-2.0 + license_family: Apache + size: 157864 + timestamp: 1734433578570 +- kind: conda + name: aws-c-mqtt + version: 0.11.0 + build: h11f4f37_12 + build_number: 12 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-mqtt-0.11.0-h11f4f37_12.conda + sha256: 512d3969426152d9d5fd886e27b13706122dc3fa90eb08c37b0d51a33d7bb14a + md5: 96c3e0221fa2da97619ee82faa341a73 + depends: + - __glibc >=2.17,<3.0.a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - aws-c-http >=0.9.2,<0.9.3.0a0 + - aws-c-io >=0.15.3,<0.15.4.0a0 + - libgcc >=13 + license: Apache-2.0 + license_family: Apache + size: 194672 + timestamp: 1734025626798 +- kind: conda + name: aws-c-mqtt + version: 0.11.0 + build: h6850007_5 + build_number: 5 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libcxx-19.1.3-ha82da77_0.conda - sha256: 6d062760c6439e75b9a44d800d89aff60fe3441998d87506c62dc94c50412ef4 - md5: bf691071fba4734984231617783225bc + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-mqtt-0.11.0-h6850007_5.conda + sha256: 9cfcea2aa6020e6af635ab3390eeee6949461ca65565fa7d08d599fdeebcf2af + md5: bec16e1070d9ebfc27bde490c68fe9d9 depends: - __osx >=11.0 - license: Apache-2.0 WITH LLVM-exception + - aws-c-common >=0.10.0,<0.10.1.0a0 + - aws-c-http >=0.9.0,<0.9.1.0a0 + - aws-c-io >=0.15.1,<0.15.2.0a0 + license: Apache-2.0 license_family: Apache - size: 520771 - timestamp: 1730314603920 + size: 134402 + timestamp: 1731071303588 - kind: conda - name: libedit - version: 3.1.20191231 - build: hc8eb9b7_2 - build_number: 2 + name: aws-c-s3 + version: 0.7.0 + build: h2bee52d_7 + build_number: 7 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libedit-3.1.20191231-hc8eb9b7_2.tar.bz2 - sha256: 3912636197933ecfe4692634119e8644904b41a58f30cad9d1fc02f6ba4d9fca - md5: 30e4362988a2623e9eb34337b83e01f9 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-s3-0.7.0-h2bee52d_7.conda + sha256: b5203bfe36cc18ffb7c6270d1334c5525ba4dea6a86a2130dba80a8d4df64621 + md5: 651d54a474bf4663cd4acbb9c63ba261 depends: - - ncurses >=6.2,<7.0.0a0 - license: BSD-2-Clause - license_family: BSD - size: 96607 - timestamp: 1597616630749 + - __osx >=11.0 + - aws-c-auth >=0.8.0,<0.8.1.0a0 + - aws-c-cal >=0.8.0,<0.8.1.0a0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + - aws-c-http >=0.9.0,<0.9.1.0a0 + - aws-c-io >=0.15.1,<0.15.2.0a0 + - aws-checksums >=0.2.0,<0.2.1.0a0 + license: Apache-2.0 + license_family: Apache + size: 96879 + timestamp: 1730946671946 - kind: conda - name: libedit - version: 3.1.20191231 - build: he28a2e2_2 + name: aws-c-s3 + version: 0.7.7 + build: hf454442_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-s3-0.7.7-hf454442_0.conda + sha256: c2f205a7bf64c5f40eea373b3a0a7c363c9aa9246a13dd7f3d9c6a4434c4fe2d + md5: 947c82025693bebd557f782bb5d6b469 + depends: + - __glibc >=2.17,<3.0.a0 + - aws-c-auth >=0.8.0,<0.8.1.0a0 + - aws-c-cal >=0.8.1,<0.8.2.0a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - aws-c-http >=0.9.2,<0.9.3.0a0 + - aws-c-io >=0.15.3,<0.15.4.0a0 + - aws-checksums >=0.2.2,<0.2.3.0a0 + - libgcc >=13 + - openssl >=3.4.0,<4.0a0 + license: Apache-2.0 + license_family: Apache + size: 114156 + timestamp: 1734146123386 +- kind: conda + name: aws-c-sdkutils + version: 0.2.1 + build: h0b63f77_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-c-sdkutils-0.2.1-h0b63f77_0.conda + sha256: 1f17f70ada62bbfd900fb051f8a3988c7436e45fe69d5e9aa69bf0154983d1f9 + md5: c399890eb4c3c3fb1b4b4838cd7d7208 + depends: + - __osx >=11.0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + license: Apache-2.0 + license_family: Apache + size: 49901 + timestamp: 1731032979942 +- kind: conda + name: aws-c-sdkutils + version: 0.2.1 + build: h4e1184b_4 + build_number: 4 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-c-sdkutils-0.2.1-h4e1184b_4.conda + sha256: df586f42210af1134b1c88ff4c278c3cb6d6c807c84eac48860062464b28554d + md5: a5126a90e74ac739b00564a4c7ddcc36 + depends: + - __glibc >=2.17,<3.0.a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - libgcc >=13 + license: Apache-2.0 + license_family: Apache + size: 56094 + timestamp: 1733994449690 +- kind: conda + name: aws-checksums + version: 0.2.0 + build: h8a8b6a7_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-checksums-0.2.0-h8a8b6a7_1.conda + sha256: 1297ef83c67e9b0cb2bf80abf7ff1c05d62d485dd9eda963318d338e18cb89bd + md5: d9db2bb8ced62ee3d6bfc32b46c5af1f + depends: + - __osx >=11.0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + license: Apache-2.0 + license_family: Apache + size: 70094 + timestamp: 1729811351952 +- kind: conda + name: aws-checksums + version: 0.2.2 + build: h4e1184b_4 + build_number: 4 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-checksums-0.2.2-h4e1184b_4.conda + sha256: 1ed9a332d06ad595694907fad2d6d801082916c27cd5076096fda4061e6d24a8 + md5: 74e8c3e4df4ceae34aa2959df4b28101 + depends: + - __glibc >=2.17,<3.0.a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - libgcc >=13 + license: Apache-2.0 + license_family: Apache + size: 72762 + timestamp: 1733994347547 +- kind: conda + name: aws-crt-cpp + version: 0.29.3 + build: h7abc90e_2 build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-crt-cpp-0.29.3-h7abc90e_2.conda + sha256: c187663950bad364957cf490c0a380312ac018852eeaaa996750149d80fe90f0 + md5: 38a65640b8885238fb6155718d7c52b0 + depends: + - __osx >=11.0 + - aws-c-auth >=0.8.0,<0.8.1.0a0 + - aws-c-cal >=0.8.0,<0.8.1.0a0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + - aws-c-event-stream >=0.5.0,<0.5.1.0a0 + - aws-c-http >=0.9.0,<0.9.1.0a0 + - aws-c-io >=0.15.1,<0.15.2.0a0 + - aws-c-mqtt >=0.11.0,<0.11.1.0a0 + - aws-c-s3 >=0.7.0,<0.7.1.0a0 + - aws-c-sdkutils >=0.2.1,<0.2.2.0a0 + - libcxx >=18 + license: Apache-2.0 + license_family: Apache + size: 229711 + timestamp: 1731132858133 +- kind: conda + name: aws-crt-cpp + version: 0.29.7 + build: hd92328a_7 + build_number: 7 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2 - sha256: a57d37c236d8f7c886e01656f4949d9dcca131d2a0728609c6f7fa338b65f1cf - md5: 4d331e44109e3f0e19b4cb8f9b82f3e1 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-crt-cpp-0.29.7-hd92328a_7.conda + sha256: 094cd81f1e5ba713e9e7a272ee52b5dde3ccc4842ea90f19c0354a00bbdac3d9 + md5: 02b95564257d5c3db9c06beccf711f95 depends: - - libgcc-ng >=7.5.0 - - ncurses >=6.2,<7.0.0a0 - license: BSD-2-Clause - license_family: BSD - size: 123878 - timestamp: 1597616541093 + - __glibc >=2.17,<3.0.a0 + - aws-c-auth >=0.8.0,<0.8.1.0a0 + - aws-c-cal >=0.8.1,<0.8.2.0a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - aws-c-event-stream >=0.5.0,<0.5.1.0a0 + - aws-c-http >=0.9.2,<0.9.3.0a0 + - aws-c-io >=0.15.3,<0.15.4.0a0 + - aws-c-mqtt >=0.11.0,<0.11.1.0a0 + - aws-c-s3 >=0.7.7,<0.7.8.0a0 + - aws-c-sdkutils >=0.2.1,<0.2.2.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: Apache-2.0 + license_family: Apache + size: 354703 + timestamp: 1734177883319 - kind: conda - name: libexpat - version: 2.6.3 - build: h5888daf_0 + name: aws-sdk-cpp + version: 1.11.407 + build: h124cfea_9 + build_number: 9 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/aws-sdk-cpp-1.11.407-h124cfea_9.conda + sha256: 52260e96642a44db84e38cb01dfc99d8c134e2676fafc90dc38c82453f7751d5 + md5: 08c1305729417bd80910219c37eef1e8 + depends: + - __osx >=11.0 + - aws-c-common >=0.10.0,<0.10.1.0a0 + - aws-c-event-stream >=0.5.0,<0.5.1.0a0 + - aws-checksums >=0.2.0,<0.2.1.0a0 + - aws-crt-cpp >=0.29.3,<0.29.4.0a0 + - libcurl >=8.10.1,<9.0a0 + - libcxx >=18 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: Apache-2.0 + license_family: Apache + size: 2689578 + timestamp: 1731098196015 +- kind: conda + name: aws-sdk-cpp + version: 1.11.458 + build: hc430e4a_4 + build_number: 4 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.3-h5888daf_0.conda - sha256: 4bb47bb2cd09898737a5211e2992d63c555d63715a07ba56eae0aff31fb89c22 - md5: 59f4c43bb1b5ef1c71946ff2cbf59524 + url: https://conda.anaconda.org/conda-forge/linux-64/aws-sdk-cpp-1.11.458-hc430e4a_4.conda + sha256: 2dc09f6f9c49127b5f96e7535b64a9c521b944d76d8b7d03d48ae80257ac1cea + md5: aeefac461bea1f126653c1285cf5af08 depends: - __glibc >=2.17,<3.0.a0 + - aws-c-common >=0.10.6,<0.10.7.0a0 + - aws-c-event-stream >=0.5.0,<0.5.1.0a0 + - aws-checksums >=0.2.2,<0.2.3.0a0 + - aws-crt-cpp >=0.29.7,<0.29.8.0a0 + - libcurl >=8.11.1,<9.0a0 - libgcc >=13 - constrains: - - expat 2.6.3.* + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.4.0,<4.0a0 + license: Apache-2.0 + license_family: Apache + size: 3060561 + timestamp: 1734093737431 +- kind: conda + name: azure-core-cpp + version: 1.14.0 + build: h5cfcd09_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/azure-core-cpp-1.14.0-h5cfcd09_0.conda + sha256: fe07debdb089a3db17f40a7f20d283d75284bb4fc269ef727b8ba6fc93f7cb5a + md5: 0a8838771cc2e985cd295e01ae83baf1 + depends: + - __glibc >=2.17,<3.0.a0 + - libcurl >=8.10.1,<9.0a0 + - libgcc >=13 + - libstdcxx >=13 + - openssl >=3.3.2,<4.0a0 license: MIT license_family: MIT - size: 73616 - timestamp: 1725568742634 + size: 345117 + timestamp: 1728053909574 - kind: conda - name: libexpat - version: 2.6.3 - build: hf9b8971_0 + name: azure-core-cpp + version: 1.14.0 + build: hd50102c_0 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libexpat-2.6.3-hf9b8971_0.conda - sha256: 5cbe5a199fba14ade55457a468ce663aac0b54832c39aa54470b3889b4c75c4a - md5: 5f22f07c2ab2dea8c66fe9585a062c96 + url: https://conda.anaconda.org/conda-forge/osx-arm64/azure-core-cpp-1.14.0-hd50102c_0.conda + sha256: f5b91329ed59ffc0be8747784c6e4cc7e56250c54032883a83bc11808ef6a87e + md5: f093a11dcf3cdcca010b20a818fcc6dc depends: - __osx >=11.0 - constrains: - - expat 2.6.3.* + - libcurl >=8.10.1,<9.0a0 + - libcxx >=17 + - openssl >=3.3.2,<4.0a0 license: MIT license_family: MIT - size: 63895 - timestamp: 1725568783033 + size: 294299 + timestamp: 1728054014060 - kind: conda - name: libffi - version: 3.4.2 - build: h3422bc3_5 - build_number: 5 - subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.4.2-h3422bc3_5.tar.bz2 - sha256: 41b3d13efb775e340e4dba549ab5c029611ea6918703096b2eaa9c015c0750ca - md5: 086914b672be056eb70fd4285b6783b6 + name: azure-identity-cpp + version: 1.10.0 + build: h113e628_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/azure-identity-cpp-1.10.0-h113e628_0.conda + sha256: 286b31616c191486626cb49e9ceb5920d29394b9e913c23adb7eb637629ba4de + md5: 73f73f60854f325a55f1d31459f2ab73 + depends: + - __glibc >=2.17,<3.0.a0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - libgcc >=13 + - libstdcxx >=13 + - openssl >=3.3.2,<4.0a0 license: MIT license_family: MIT - size: 39020 - timestamp: 1636488587153 + size: 232351 + timestamp: 1728486729511 - kind: conda - name: libffi - version: 3.4.2 - build: h7f98852_5 - build_number: 5 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2 - sha256: ab6e9856c21709b7b517e940ae7028ae0737546122f83c2aa5d692860c3b149e - md5: d645c6d2ac96843a2bfaccd2d62b3ac3 + name: azure-identity-cpp + version: 1.10.0 + build: hc602bab_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/azure-identity-cpp-1.10.0-hc602bab_0.conda + sha256: bde446b916fff5150606f8ed3e6058ffc55a3aa72381e46f1ab346590b1ae40a + md5: d7b71593a937459f2d4b67e1a4727dc2 depends: - - libgcc-ng >=9.4.0 + - __osx >=11.0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - libcxx >=17 + - openssl >=3.3.2,<4.0a0 license: MIT license_family: MIT - size: 58292 - timestamp: 1636488182923 + size: 166907 + timestamp: 1728486882502 - kind: conda - name: libgcc - version: 14.2.0 - build: h77fa898_1 + name: azure-storage-blobs-cpp + version: 12.13.0 + build: h3cf044e_1 build_number: 1 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda - sha256: 53eb8a79365e58849e7b1a068d31f4f9e718dc938d6f2c03e960345739a03569 - md5: 3cb76c3f10d3bc7f1105b2fc9db984df + url: https://conda.anaconda.org/conda-forge/linux-64/azure-storage-blobs-cpp-12.13.0-h3cf044e_1.conda + sha256: 2606260e5379eed255bcdc6adc39b93fb31477337bcd911c121fc43cd29bf394 + md5: 7eb66060455c7a47d9dcdbfa9f46579b depends: - - _libgcc_mutex 0.1 conda_forge - - _openmp_mutex >=4.5 - constrains: - - libgomp 14.2.0 h77fa898_1 - - libgcc-ng ==14.2.0=*_1 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 848745 - timestamp: 1729027721139 + - __glibc >=2.17,<3.0.a0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - azure-storage-common-cpp >=12.8.0,<12.8.1.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: MIT + license_family: MIT + size: 549342 + timestamp: 1728578123088 - kind: conda - name: libgcc-ng - version: 14.2.0 - build: h69a702a_1 + name: azure-storage-blobs-cpp + version: 12.13.0 + build: h7585a09_1 build_number: 1 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.2.0-h69a702a_1.conda - sha256: 3a76969c80e9af8b6e7a55090088bc41da4cffcde9e2c71b17f44d37b7cb87f7 - md5: e39480b9ca41323497b05492a63bc35b - depends: - - libgcc 14.2.0 h77fa898_1 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 54142 - timestamp: 1729027726517 -- kind: conda - name: libgfortran - version: 5.0.0 - build: 13_2_0_hd922786_3 - build_number: 3 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libgfortran-5.0.0-13_2_0_hd922786_3.conda - sha256: 44e541b4821c96b28b27fef5630883a60ce4fee91fd9c79f25a199f8f73f337b - md5: 4a55d9e169114b2b90d3ec4604cd7bbf + url: https://conda.anaconda.org/conda-forge/osx-arm64/azure-storage-blobs-cpp-12.13.0-h7585a09_1.conda + sha256: 08d52d130addc0fb55d5ba10d9fa483e39be25d69bac7f4c676c2c3069207590 + md5: 704238ef05d46144dae2e6b5853df8bc depends: - - libgfortran5 13.2.0 hf226fd6_3 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 110233 - timestamp: 1707330749033 + - __osx >=11.0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - azure-storage-common-cpp >=12.8.0,<12.8.1.0a0 + - libcxx >=17 + license: MIT + license_family: MIT + size: 438636 + timestamp: 1728578216193 - kind: conda - name: libgfortran - version: 14.2.0 - build: h69a702a_1 + name: azure-storage-common-cpp + version: 12.8.0 + build: h736e048_1 build_number: 1 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-14.2.0-h69a702a_1.conda - sha256: fc9e7f22a17faf74da904ebfc4d88699013d2992e55505e4aa0eb01770290977 - md5: f1fd30127802683586f768875127a987 + url: https://conda.anaconda.org/conda-forge/linux-64/azure-storage-common-cpp-12.8.0-h736e048_1.conda + sha256: 273475f002b091b66ce7366da04bf164c3732c03f8692ab2ee2d23335b6a82ba + md5: 13de36be8de3ae3f05ba127631599213 depends: - - libgfortran5 14.2.0 hd5240d6_1 - constrains: - - libgfortran-ng ==14.2.0=*_1 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 53997 - timestamp: 1729027752995 + - __glibc >=2.17,<3.0.a0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - libgcc >=13 + - libstdcxx >=13 + - libxml2 >=2.12.7,<3.0a0 + - openssl >=3.3.2,<4.0a0 + license: MIT + license_family: MIT + size: 149312 + timestamp: 1728563338704 - kind: conda - name: libgfortran-ng - version: 14.2.0 - build: h69a702a_1 + name: azure-storage-common-cpp + version: 12.8.0 + build: h9ca1f76_1 build_number: 1 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-14.2.0-h69a702a_1.conda - sha256: 423f1e2403f0c665748e42d335e421e53fd03c08d457cfb6f360d329d9459851 - md5: 0a7f4cd238267c88e5d69f7826a407eb - depends: - - libgfortran 14.2.0 h69a702a_1 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 54106 - timestamp: 1729027945817 -- kind: conda - name: libgfortran5 - version: 13.2.0 - build: hf226fd6_3 - build_number: 3 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libgfortran5-13.2.0-hf226fd6_3.conda - sha256: bafc679eedb468a86aa4636061c55966186399ee0a04b605920d208d97ac579a - md5: 66ac81d54e95c534ae488726c1f698ea + url: https://conda.anaconda.org/conda-forge/osx-arm64/azure-storage-common-cpp-12.8.0-h9ca1f76_1.conda + sha256: 77ab04e8fe5636a2de9c718f72a43645f7502cd208868c8a91ffba385547d585 + md5: 7a187cd7b1445afc80253bb186a607cc depends: - - llvm-openmp >=8.0.0 - constrains: - - libgfortran 5.0.0 13_2_0_*_3 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 997381 - timestamp: 1707330687590 + - __osx >=11.0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - libcxx >=17 + - libxml2 >=2.12.7,<3.0a0 + - openssl >=3.3.2,<4.0a0 + license: MIT + license_family: MIT + size: 121278 + timestamp: 1728563418777 - kind: conda - name: libgfortran5 - version: 14.2.0 - build: hd5240d6_1 + name: azure-storage-files-datalake-cpp + version: 12.12.0 + build: ha633028_1 build_number: 1 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-14.2.0-hd5240d6_1.conda - sha256: d149a37ca73611e425041f33b9d8dbed6e52ec506fe8cc1fc0ee054bddeb6d5d - md5: 9822b874ea29af082e5d36098d25427d + url: https://conda.anaconda.org/conda-forge/linux-64/azure-storage-files-datalake-cpp-12.12.0-ha633028_1.conda + sha256: 5371e4f3f920933bb89b926a85a67f24388227419abd6e99f6086481e5e8d5f2 + md5: 7c1980f89dd41b097549782121a73490 depends: - - libgcc >=14.2.0 - constrains: - - libgfortran 14.2.0 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 1462645 - timestamp: 1729027735353 + - __glibc >=2.17,<3.0.a0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - azure-storage-blobs-cpp >=12.13.0,<12.13.1.0a0 + - azure-storage-common-cpp >=12.8.0,<12.8.1.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: MIT + license_family: MIT + size: 287366 + timestamp: 1728729530295 - kind: conda - name: libgomp - version: 14.2.0 - build: h77fa898_1 + name: azure-storage-files-datalake-cpp + version: 12.12.0 + build: hcdd55da_1 build_number: 1 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda - sha256: 1911c29975ec99b6b906904040c855772ccb265a1c79d5d75c8ceec4ed89cd63 - md5: cc3573974587f12dda90d96e3e55a702 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/azure-storage-files-datalake-cpp-12.12.0-hcdd55da_1.conda + sha256: f48523f8aa0b5b80f45a92f0556b388dd96f44ac2dc2f44a01d08c1822eec97d + md5: c49fbc5233fcbaa86391162ff1adef38 depends: - - _libgcc_mutex 0.1 conda_forge - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 460992 - timestamp: 1729027639220 + - __osx >=11.0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - azure-storage-blobs-cpp >=12.13.0,<12.13.1.0a0 + - azure-storage-common-cpp >=12.8.0,<12.8.1.0a0 + - libcxx >=17 + license: MIT + license_family: MIT + size: 196032 + timestamp: 1728729672889 - kind: conda - name: liblapack - version: 3.9.0 - build: 25_linux64_openblas - build_number: 25 + name: backoff + version: 2.2.1 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/backoff-2.2.1-pyhd8ed1ab_1.conda + sha256: f334115c6b0c6c2cd0d28595365f205ec7eaa60bcc5ff91a75d7245f728be820 + md5: a38b801f2bcc12af80c2e02a9e4ce7d9 + depends: + - python >=3.9 + license: MIT + license_family: MIT + size: 18816 + timestamp: 1733771192649 +- kind: conda + name: brotli-python + version: 1.1.0 + build: py312h2ec8cdc_2 + build_number: 2 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-25_linux64_openblas.conda - sha256: 9d1ff017714edb2d84868f0f931a4a0e7c289a971062b2ac66cfc8145df7e20e - md5: 4dc03a53fc69371a6158d0ed37214cd3 + url: https://conda.anaconda.org/conda-forge/linux-64/brotli-python-1.1.0-py312h2ec8cdc_2.conda + sha256: f2a59ccd20b4816dea9a2a5cb917eb69728271dbf1aeab4e1b7e609330a50b6f + md5: b0b867af6fc74b2a0aa206da29c0f3cf depends: - - libblas 3.9.0 25_linux64_openblas + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 constrains: - - liblapacke 3.9.0 25_linux64_openblas - - libcblas 3.9.0 25_linux64_openblas - - blas * openblas - license: BSD-3-Clause - license_family: BSD - size: 15608 - timestamp: 1729642910812 + - libbrotlicommon 1.1.0 hb9d3cd8_2 + license: MIT + license_family: MIT + size: 349867 + timestamp: 1725267732089 - kind: conda - name: liblapack - version: 3.9.0 - build: 25_osxarm64_openblas - build_number: 25 + name: brotli-python + version: 1.1.0 + build: py312hde4cb15_2 + build_number: 2 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/liblapack-3.9.0-25_osxarm64_openblas.conda - sha256: fdd742407672a9af20e70764550cf18b3ab67f12e48bf04163b90492fbc401e7 - md5: 19bbddfec972d401838330453186108d + url: https://conda.anaconda.org/conda-forge/osx-arm64/brotli-python-1.1.0-py312hde4cb15_2.conda + sha256: 254b411fa78ccc226f42daf606772972466f93e9bc6895eabb4cfda22f5178af + md5: a83c2ef76ccb11bc2349f4f17696b15d depends: - - libblas 3.9.0 25_osxarm64_openblas + - __osx >=11.0 + - libcxx >=17 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 constrains: - - blas * openblas - - liblapacke 3.9.0 25_osxarm64_openblas - - libcblas 3.9.0 25_osxarm64_openblas - license: BSD-3-Clause - license_family: BSD - size: 15823 - timestamp: 1729643275943 + - libbrotlicommon 1.1.0 hd74edd7_2 + license: MIT + license_family: MIT + size: 339360 + timestamp: 1725268143995 - kind: conda - name: libnsl - version: 2.0.1 - build: hd590300_0 + name: bzip2 + version: 1.0.8 + build: h4bc722e_7 + build_number: 7 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda - sha256: 26d77a3bb4dceeedc2a41bd688564fe71bf2d149fdcf117049970bc02ff1add6 - md5: 30fd6e37fe21f86f4bd26d6ee73eeec7 + url: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-h4bc722e_7.conda + sha256: 5ced96500d945fb286c9c838e54fa759aa04a7129c59800f0846b4335cee770d + md5: 62ee74e96c5ebb0af99386de58cf9553 depends: + - __glibc >=2.17,<3.0.a0 - libgcc-ng >=12 - license: LGPL-2.1-only - license_family: GPL - size: 33408 - timestamp: 1697359010159 + license: bzip2-1.0.6 + license_family: BSD + size: 252783 + timestamp: 1720974456583 - kind: conda - name: libopenblas - version: 0.3.28 - build: openmp_h517c56d_0 + name: bzip2 + version: 1.0.8 + build: h99b78c6_7 + build_number: 7 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libopenblas-0.3.28-openmp_h517c56d_0.conda - sha256: 43d69d072f1a3774994d31f9d3241cfa0f1c5560b536989020d7cde30fbef956 - md5: 9306fd5b6b39b2b7e13c1d50c3fee354 + url: https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-h99b78c6_7.conda + sha256: adfa71f158cbd872a36394c56c3568e6034aa55c623634b37a4836bd036e6b91 + md5: fc6948412dbbbe9a4c9ddbbcfe0a79ab depends: - __osx >=11.0 - - libgfortran 5.* - - libgfortran5 >=12.3.0 - - llvm-openmp >=16.0.6 + license: bzip2-1.0.6 + license_family: BSD + size: 122909 + timestamp: 1720974522888 +- kind: conda + name: c-ares + version: 1.34.4 + build: h5505292_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/c-ares-1.34.4-h5505292_0.conda + sha256: 09c0c8476e50b2955f474a4a1c17c4c047dd52993b5366b6ea8e968e583b921f + md5: c1c999a38a4303b29d75c636eaa13cf9 + depends: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 179496 + timestamp: 1734208291879 +- kind: conda + name: c-ares + version: 1.34.4 + build: hb9d3cd8_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.34.4-hb9d3cd8_0.conda + sha256: d4f28d87b6339b94f74762c0076e29c8ef8ddfff51a564a92da2843573c18320 + md5: e2775acf57efd5af15b8e3d1d74d72d3 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 206085 + timestamp: 1734208189009 +- kind: conda + name: ca-certificates + version: 2024.8.30 + build: hbcca054_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.8.30-hbcca054_0.conda + sha256: afee721baa6d988e27fef1832f68d6f32ac8cc99cdf6015732224c2841a09cea + md5: c27d1c142233b5bc9ca570c6e2e0c244 + license: ISC + size: 159003 + timestamp: 1725018903918 +- kind: conda + name: ca-certificates + version: 2024.8.30 + build: hf0a4a13_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/ca-certificates-2024.8.30-hf0a4a13_0.conda + sha256: 2db1733f4b644575dbbdd7994a8f338e6ef937f5ebdb74acd557e9dda0211709 + md5: 40dec13fd8348dbe303e57be74bd3d35 + license: ISC + size: 158482 + timestamp: 1725019034582 +- kind: conda + name: certifi + version: 2024.12.14 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/certifi-2024.12.14-pyhd8ed1ab_0.conda + sha256: 048c16a9cbcb1fbad02083414d3bc7c1d0eea4b39aee6aa6bf8d1d5089ca8bad + md5: 6feb87357ecd66733be3279f16a8c400 + depends: + - python >=3.9 + license: ISC + size: 161642 + timestamp: 1734380604767 +- kind: conda + name: cffi + version: 1.17.1 + build: py312h06ac9bb_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/cffi-1.17.1-py312h06ac9bb_0.conda + sha256: cba6ea83c4b0b4f5b5dc59cb19830519b28f95d7ebef7c9c5cf1c14843621457 + md5: a861504bbea4161a9170b85d4d2be840 + depends: + - __glibc >=2.17,<3.0.a0 + - libffi >=3.4,<4.0a0 + - libgcc >=13 + - pycparser + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + size: 294403 + timestamp: 1725560714366 +- kind: conda + name: cffi + version: 1.17.1 + build: py312h0fad829_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/cffi-1.17.1-py312h0fad829_0.conda + sha256: 8d91a0d01358b5c3f20297c6c536c5d24ccd3e0c2ddd37f9d0593d0f0070226f + md5: 19a5456f72f505881ba493979777b24e + depends: + - __osx >=11.0 + - libffi >=3.4,<4.0a0 + - pycparser + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + size: 281206 + timestamp: 1725560813378 +- kind: conda + name: charset-normalizer + version: 3.4.0 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.0-pyhd8ed1ab_1.conda + sha256: 63022ee2c6a157a9f980250a66f54bdcdf5abee817348d0f9a74c2441a6fbf0e + md5: 6581a17bba6b948bb60130026404a9d6 + depends: + - python >=3.9 + license: MIT + license_family: MIT + size: 47533 + timestamp: 1733218182393 +- kind: conda + name: click + version: 8.1.7 + build: unix_pyh707e725_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/click-8.1.7-unix_pyh707e725_0.conda + sha256: f0016cbab6ac4138a429e28dbcb904a90305b34b3fe41a9b89d697c90401caec + md5: f3ad426304898027fc619827ff428eca + depends: + - __unix + - python >=3.8 + license: BSD-3-Clause + license_family: BSD + size: 84437 + timestamp: 1692311973840 +- kind: conda + name: colorama + version: 0.4.6 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + sha256: ab29d57dc70786c1269633ba3dff20288b81664d3ff8d21af995742e2bb03287 + md5: 962b9857ee8e7018c22f2776ffa0b2d7 + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + size: 27011 + timestamp: 1733218222191 +- kind: conda + name: datasets + version: 2.14.4 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/datasets-2.14.4-pyhd8ed1ab_0.conda + sha256: 7e09bd083a609138b780fcc4535924cb96814d2c908a36d4c64a2ba9ee3efe7f + md5: 3e087f072ce03c43a9b60522f5d0ca2f + depends: + - aiohttp + - dill >=0.3.0,<0.3.8 + - fsspec >=2021.11.1 + - huggingface_hub >=0.14.0,<1.0.0 + - importlib-metadata + - multiprocess + - numpy >=1.17 + - packaging + - pandas + - pyarrow >=8.0.0 + - python >=3.8.0 + - python-xxhash + - pyyaml >=5.1 + - requests >=2.19.0 + - tqdm >=4.62.1 + license: Apache-2.0 + license_family: Apache + size: 347303 + timestamp: 1691593908658 +- kind: conda + name: deprecated + version: 1.2.15 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/deprecated-1.2.15-pyhd8ed1ab_1.conda + sha256: a20ebf2c9b02a6eb32412ceb5c4cffaae49417db7e75414a76417538293a9402 + md5: eaef2e94d5bd76f758545d172c1fda67 + depends: + - python >=3.9 + - wrapt <2,>=1.10 + license: MIT + license_family: MIT + size: 14297 + timestamp: 1733662697343 +- kind: conda + name: dill + version: 0.3.7 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/dill-0.3.7-pyhd8ed1ab_0.conda + sha256: 4ff20c6be028be2825235631c45d9e4a75bca1de65f8840c02dfb28ea0137c45 + md5: 5e4f3466526c52bc9af2d2353a1460bd + depends: + - python >=3.7 + license: BSD-3-Clause + license_family: BSD + size: 87553 + timestamp: 1690101185422 +- kind: conda + name: dnspython + version: 2.7.0 + build: pyhff2d567_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/dnspython-2.7.0-pyhff2d567_1.conda + sha256: 3ec40ccf63f2450c5e6c7dd579e42fc2e97caf0d8cd4ba24aa434e6fc264eda0 + md5: 5fbd60d61d21b4bd2f9d7a48fe100418 + depends: + - python >=3.9,<4.0.0 + - sniffio + constrains: + - aioquic >=1.0.0 + - wmi >=1.5.1 + - httpx >=0.26.0 + - trio >=0.23 + - cryptography >=43 + - httpcore >=1.0.0 + - idna >=3.7 + - h2 >=4.1.0 + license: ISC + license_family: OTHER + size: 172172 + timestamp: 1733256829961 +- kind: conda + name: email-validator + version: 2.2.0 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/email-validator-2.2.0-pyhd8ed1ab_1.conda + sha256: b91a19eb78edfc2dbb36de9a67f74ee2416f1b5273dd7327abe53f2dbf864736 + md5: da16dd3b0b71339060cd44cb7110ddf9 + depends: + - dnspython >=2.0.0 + - idna >=2.0.0 + - python >=3.9 + license: Unlicense + size: 44401 + timestamp: 1733300827551 +- kind: conda + name: email_validator + version: 2.2.0 + build: hd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: generic + url: https://conda.anaconda.org/conda-forge/noarch/email_validator-2.2.0-hd8ed1ab_1.conda + sha256: e0d0fdf587aa0ed0ff08b2bce3ab355f46687b87b0775bfba01cc80a859ee6a2 + md5: 0794f8807ff2c6f020422cacb1bd7bfa + depends: + - email-validator >=2.2.0,<2.2.1.0a0 + license: Unlicense + size: 6552 + timestamp: 1733300828176 +- kind: conda + name: exceptiongroup + version: 1.2.2 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.2.2-pyhd8ed1ab_1.conda + sha256: cbde2c64ec317118fc06b223c5fd87c8a680255e7348dd60e7b292d2e103e701 + md5: a16662747cdeb9abbac74d0057cc976e + depends: + - python >=3.9 + license: MIT and PSF-2.0 + size: 20486 + timestamp: 1733208916977 +- kind: conda + name: fastapi + version: 0.115.4 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/fastapi-0.115.4-pyhd8ed1ab_0.conda + sha256: 69d319a58a7f929c047c0e6c1b845a3b384840ff95b1391516aa683f517f0929 + md5: 29841fbba8e0d4628ab513b92212def4 + depends: + - email_validator >=2.0.0 + - fastapi-cli >=0.0.5 + - httpx >=0.23.0 + - jinja2 >=2.11.2 + - pydantic >=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0 + - python >=3.8 + - python-multipart >=0.0.7 + - starlette >=0.40.0,<0.42.0 + - typing_extensions >=4.8.0 + - uvicorn >=0.12.0 + license: MIT + license_family: MIT + size: 73156 + timestamp: 1730122842479 +- kind: conda + name: fastapi-cli + version: 0.0.5 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/fastapi-cli-0.0.5-pyhd8ed1ab_0.conda + sha256: 72a8b8f55420207086cacf15066e234556669b4f3d6f5f8555a93a0013ed9bc9 + md5: d50cd55f356225d8440741bb911c2a78 + depends: + - fastapi + - python >=3.8 + - typer >=0.12.3 + - uvicorn >=0.15.0 + license: MIT + license_family: MIT + size: 14405 + timestamp: 1722597753588 +- kind: conda + name: filelock + version: 3.16.1 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/filelock-3.16.1-pyhd8ed1ab_1.conda + sha256: 18dca6e2194732df7ebf824abaefe999e4765ebe8e8a061269406ab88fc418b9 + md5: d692e9ba6f92dc51484bf3477e36ce7c + depends: + - python >=3.9 + license: Unlicense + size: 17441 + timestamp: 1733240909987 +- kind: conda + name: freetype + version: 2.12.1 + build: h267a509_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/freetype-2.12.1-h267a509_2.conda + sha256: b2e3c449ec9d907dd4656cb0dc93e140f447175b125a3824b31368b06c666bb6 + md5: 9ae35c3d96db2c94ce0cef86efdfa2cb + depends: + - libgcc-ng >=12 + - libpng >=1.6.39,<1.7.0a0 + - libzlib >=1.2.13,<2.0.0a0 + license: GPL-2.0-only OR FTL + size: 634972 + timestamp: 1694615932610 +- kind: conda + name: freetype + version: 2.12.1 + build: hadb7bae_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/freetype-2.12.1-hadb7bae_2.conda + sha256: 791673127e037a2dc0eebe122dc4f904cb3f6e635bb888f42cbe1a76b48748d9 + md5: e6085e516a3e304ce41a8ee08b9b89ad + depends: + - libpng >=1.6.39,<1.7.0a0 + - libzlib >=1.2.13,<2.0.0a0 + license: GPL-2.0-only OR FTL + size: 596430 + timestamp: 1694616332835 +- kind: conda + name: frozenlist + version: 1.5.0 + build: py312h0bf5046_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/frozenlist-1.5.0-py312h0bf5046_0.conda + sha256: 44d6d6b332421e621c029fb149f12dba1ccb5ed6ac632e2e807a9d92d6cb2864 + md5: 7960352935cc95ac23883c9b8c97f2ff + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + size: 53366 + timestamp: 1729699762631 +- kind: conda + name: frozenlist + version: 1.5.0 + build: py312h66e93f0_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/frozenlist-1.5.0-py312h66e93f0_0.conda + sha256: 7e0c12983b20f2816b3712729b5a35ecb7ee152132ca7cf805427c62395ea823 + md5: f98e36c96b2c66d9043187179ddb04f4 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + size: 60968 + timestamp: 1729699568442 +- kind: conda + name: fsspec + version: 2024.12.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/fsspec-2024.12.0-pyhd8ed1ab_0.conda + sha256: 3320970c4604989eadf908397a9475f9e6a96a773c185915111399cbfbe47817 + md5: e041ad4c43ab5e10c74587f95378ebc7 + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + size: 137756 + timestamp: 1734650349242 +- kind: conda + name: gflags + version: 2.2.2 + build: h5888daf_1005 + build_number: 1005 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/gflags-2.2.2-h5888daf_1005.conda + sha256: 6c33bf0c4d8f418546ba9c250db4e4221040936aef8956353bc764d4877bc39a + md5: d411fc29e338efb48c5fd4576d71d881 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + license: BSD-3-Clause + license_family: BSD + size: 119654 + timestamp: 1726600001928 +- kind: conda + name: gflags + version: 2.2.2 + build: hf9b8971_1005 + build_number: 1005 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/gflags-2.2.2-hf9b8971_1005.conda + sha256: fd56ed8a1dab72ab90d8a8929b6f916a6d9220ca297ff077f8f04c5ed3408e20 + md5: 57a511a5905caa37540eb914dfcbf1fb + depends: + - __osx >=11.0 + - libcxx >=17 + license: BSD-3-Clause + license_family: BSD + size: 82090 + timestamp: 1726600145480 +- kind: conda + name: glog + version: 0.7.1 + build: hbabe93e_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/glog-0.7.1-hbabe93e_0.conda + sha256: dc824dc1d0aa358e28da2ecbbb9f03d932d976c8dca11214aa1dcdfcbd054ba2 + md5: ff862eebdfeb2fd048ae9dc92510baca + depends: + - gflags >=2.2.2,<2.3.0a0 + - libgcc-ng >=12 + - libstdcxx-ng >=12 + license: BSD-3-Clause + license_family: BSD + size: 143452 + timestamp: 1718284177264 +- kind: conda + name: glog + version: 0.7.1 + build: heb240a5_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/glog-0.7.1-heb240a5_0.conda + sha256: 9fc77de416953aa959039db72bc41bfa4600ae3ff84acad04a7d0c1ab9552602 + md5: fef68d0a95aa5b84b5c1a4f6f3bf40e1 + depends: + - __osx >=11.0 + - gflags >=2.2.2,<2.3.0a0 + - libcxx >=16 + license: BSD-3-Clause + license_family: BSD + size: 112215 + timestamp: 1718284365403 +- kind: conda + name: googleapis-common-protos + version: 1.66.0 + build: pyhff2d567_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/googleapis-common-protos-1.66.0-pyhff2d567_0.conda + sha256: d8d19575a827f2c62500949b9536efdd6b5406c9f546a73b6a87ac90b03a5875 + md5: 4861e30ff0cd566ea6fb4593e3b7c22a + depends: + - protobuf >=3.20.2,<6.0.0.dev0,!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5 + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 116522 + timestamp: 1731459019854 +- kind: conda + name: h11 + version: 0.14.0 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/h11-0.14.0-pyhd8ed1ab_1.conda + sha256: 622516185a7c740d5c7f27016d0c15b45782c1501e5611deec63fd70344ce7c8 + md5: 7ee49e89531c0dcbba9466f6d115d585 + depends: + - python >=3.9 + - typing_extensions + license: MIT + license_family: MIT + size: 51846 + timestamp: 1733327599467 +- kind: conda + name: h2 + version: 4.1.0 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/h2-4.1.0-pyhd8ed1ab_1.conda + sha256: 843ddad410c370672a8250470697027618f104153612439076d4d7b91eeb7b5c + md5: 825927dc7b0f287ef8d4d0011bb113b1 + depends: + - hpack >=4.0,<5 + - hyperframe >=6.0,<7 + - python >=3.9 + license: MIT + license_family: MIT + size: 52000 + timestamp: 1733298867359 +- kind: conda + name: hpack + version: 4.0.0 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/hpack-4.0.0-pyhd8ed1ab_1.conda + sha256: ec89b7e5b8aa2f0219f666084446e1fb7b54545861e9caa892acb24d125761b5 + md5: 2aa5ff7fa34a81b9196532c84c10d865 + depends: + - python >=3.9 + license: MIT + license_family: MIT + size: 29412 + timestamp: 1733299296857 +- kind: conda + name: httpcore + version: 1.0.7 + build: pyh29332c3_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/httpcore-1.0.7-pyh29332c3_1.conda + sha256: c84d012a245171f3ed666a8bf9319580c269b7843ffa79f26468842da3abd5df + md5: 2ca8e6dbc86525c8b95e3c0ffa26442e + depends: + - python >=3.8 + - h11 >=0.13,<0.15 + - h2 >=3,<5 + - sniffio 1.* + - anyio >=3.0,<5.0 + - certifi + license: BSD-3-Clause + license_family: BSD + size: 48959 + timestamp: 1731707562362 +- kind: conda + name: httpx + version: 0.28.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/httpx-0.28.1-pyhd8ed1ab_0.conda + sha256: cd0f1de3697b252df95f98383e9edb1d00386bfdd03fdf607fa42fe5fcb09950 + md5: d6989ead454181f4f9bc987d3dc4e285 + depends: + - anyio + - certifi + - httpcore 1.* + - idna + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + size: 63082 + timestamp: 1733663449209 +- kind: conda + name: huggingface_hub + version: 0.26.5 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/huggingface_hub-0.26.5-pyhd8ed1ab_1.conda + sha256: 0c75532d914a04c73222be298ed2c6868739dd475b1b1a9137c52abe79873952 + md5: 73937038e21117fe401f8ea64fbaeacc + depends: + - filelock + - fsspec >=2023.5.0 + - packaging >=20.9 + - python >=3.9 + - pyyaml >=5.1 + - requests + - tqdm >=4.42.1 + - typing-extensions >=3.7.4.3 + - typing_extensions >=3.7.4.3 + license: Apache-2.0 + license_family: APACHE + size: 275466 + timestamp: 1733852454004 +- kind: conda + name: hyperframe + version: 6.0.1 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/hyperframe-6.0.1-pyhd8ed1ab_1.conda + sha256: e91c6ef09d076e1d9a02819cd00fa7ee18ecf30cdd667605c853980216584d1b + md5: 566e75c90c1d0c8c459eb0ad9833dc7a + depends: + - python >=3.9 + license: MIT + license_family: MIT + size: 17239 + timestamp: 1733298862681 +- kind: conda + name: icu + version: '75.1' + build: hfee45f7_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/icu-75.1-hfee45f7_0.conda + sha256: 9ba12c93406f3df5ab0a43db8a4b4ef67a5871dfd401010fbe29b218b2cbe620 + md5: 5eb22c1d7b3fc4abb50d92d621583137 + depends: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 11857802 + timestamp: 1720853997952 +- kind: conda + name: idna + version: '3.10' + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/idna-3.10-pyhd8ed1ab_1.conda + sha256: d7a472c9fd479e2e8dcb83fb8d433fce971ea369d704ece380e876f9c3494e87 + md5: 39a4f67be3286c86d696df570b1201b7 + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + size: 49765 + timestamp: 1733211921194 +- kind: conda + name: importlib-metadata + version: 8.5.0 + build: pyha770c72_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.5.0-pyha770c72_0.conda + sha256: 7194700ce1a5ad2621fd68e894dd8c1ceaff9a38723e6e0e5298fdef13017b1c + md5: 54198435fce4d64d8a89af22573012a8 + depends: + - python >=3.8 + - zipp >=0.5 + license: Apache-2.0 + license_family: APACHE + size: 28646 + timestamp: 1726082927916 +- kind: conda + name: jinja2 + version: 3.1.5 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/jinja2-3.1.5-pyhd8ed1ab_0.conda + sha256: 98977694b9ecaa3218662f843425f39501f81973c450f995eec68f1803ed71c3 + md5: 2752a6ed44105bfb18c9bef1177d9dcd + depends: + - markupsafe >=2.0 + - python >=3.9 + license: BSD-3-Clause + size: 112561 + timestamp: 1734824044952 +- kind: conda + name: jupyter_client + version: 8.6.3 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.6.3-pyhd8ed1ab_0.conda + sha256: 4419c85e209a715f551a5c9bead746f29ee9d0fc41e772a76db3868622795671 + md5: a14218cfb29662b4a19ceb04e93e298e + depends: + - importlib-metadata >=4.8.3 + - jupyter_core >=4.12,!=5.0.* + - python >=3.8 + - python-dateutil >=2.8.2 + - pyzmq >=23.0 + - tornado >=6.2 + - traitlets >=5.3 + license: BSD-3-Clause + license_family: BSD + size: 106055 + timestamp: 1726610805505 +- kind: conda + name: jupyter_core + version: 5.7.2 + build: pyh31011fe_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.7.2-pyh31011fe_1.conda + sha256: 732b1e8536bc22a5a174baa79842d79db2f4956d90293dd82dc1b3f6099bcccd + md5: 0a2980dada0dd7fd0998f0342308b1b1 + depends: + - __unix + - platformdirs >=2.5 + - python >=3.8 + - traitlets >=5.3 + license: BSD-3-Clause + license_family: BSD + size: 57671 + timestamp: 1727163547058 +- kind: conda + name: keyutils + version: 1.6.1 + build: h166bdaf_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 + sha256: 150c05a6e538610ca7c43beb3a40d65c90537497a4f6a5f4d15ec0451b6f5ebb + md5: 30186d27e2c9fa62b45fb1476b7200e3 + depends: + - libgcc-ng >=10.3.0 + license: LGPL-2.1-or-later + size: 117831 + timestamp: 1646151697040 +- kind: conda + name: krb5 + version: 1.21.3 + build: h237132a_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/krb5-1.21.3-h237132a_0.conda + sha256: 4442f957c3c77d69d9da3521268cad5d54c9033f1a73f99cde0a3658937b159b + md5: c6dc8a0fdec13a0565936655c33069a1 + depends: + - __osx >=11.0 + - libcxx >=16 + - libedit >=3.1.20191231,<3.2.0a0 + - libedit >=3.1.20191231,<4.0a0 + - openssl >=3.3.1,<4.0a0 + license: MIT + license_family: MIT + size: 1155530 + timestamp: 1719463474401 +- kind: conda + name: krb5 + version: 1.21.3 + build: h659f571_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.3-h659f571_0.conda + sha256: 99df692f7a8a5c27cd14b5fb1374ee55e756631b9c3d659ed3ee60830249b238 + md5: 3f43953b7d3fb3aaa1d0d0723d91e368 + depends: + - keyutils >=1.6.1,<2.0a0 + - libedit >=3.1.20191231,<3.2.0a0 + - libedit >=3.1.20191231,<4.0a0 + - libgcc-ng >=12 + - libstdcxx-ng >=12 + - openssl >=3.3.1,<4.0a0 + license: MIT + license_family: MIT + size: 1370023 + timestamp: 1719463201255 +- kind: conda + name: lcms2 + version: '2.16' + build: ha0e7c42_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/lcms2-2.16-ha0e7c42_0.conda + sha256: 151e0c84feb7e0747fabcc85006b8973b22f5abbc3af76a9add0b0ef0320ebe4 + md5: 66f6c134e76fe13cce8a9ea5814b5dd5 + depends: + - libjpeg-turbo >=3.0.0,<4.0a0 + - libtiff >=4.6.0,<4.8.0a0 + license: MIT + license_family: MIT + size: 211959 + timestamp: 1701647962657 +- kind: conda + name: lcms2 + version: '2.16' + build: hb7c19ff_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/lcms2-2.16-hb7c19ff_0.conda + sha256: 5c878d104b461b7ef922abe6320711c0d01772f4cd55de18b674f88547870041 + md5: 51bb7010fc86f70eee639b4bb7a894f5 + depends: + - libgcc-ng >=12 + - libjpeg-turbo >=3.0.0,<4.0a0 + - libtiff >=4.6.0,<4.8.0a0 + license: MIT + license_family: MIT + size: 245247 + timestamp: 1701647787198 +- kind: conda + name: ld_impl_linux-64 + version: '2.43' + build: h712a8e2_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.43-h712a8e2_2.conda + sha256: 7c91cea91b13f4314d125d1bedb9d03a29ebbd5080ccdea70260363424646dbe + md5: 048b02e3962f066da18efe3a21b77672 + depends: + - __glibc >=2.17,<3.0.a0 + constrains: + - binutils_impl_linux-64 2.43 + license: GPL-3.0-only + license_family: GPL + size: 669211 + timestamp: 1729655358674 +- kind: conda + name: lerc + version: 4.0.0 + build: h27087fc_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/lerc-4.0.0-h27087fc_0.tar.bz2 + sha256: cb55f36dcd898203927133280ae1dc643368af041a48bcf7c026acb7c47b0c12 + md5: 76bbff344f0134279f225174e9064c8f + depends: + - libgcc-ng >=12 + - libstdcxx-ng >=12 + license: Apache-2.0 + license_family: Apache + size: 281798 + timestamp: 1657977462600 +- kind: conda + name: lerc + version: 4.0.0 + build: h9a09cb3_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/lerc-4.0.0-h9a09cb3_0.tar.bz2 + sha256: 6f068bb53dfb6147d3147d981bb851bb5477e769407ad4e6a68edf482fdcb958 + md5: de462d5aacda3b30721b512c5da4e742 + depends: + - libcxx >=13.0.1 + license: Apache-2.0 + license_family: Apache + size: 215721 + timestamp: 1657977558796 +- kind: conda + name: libabseil + version: '20240722.0' + build: cxx17_h5888daf_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libabseil-20240722.0-cxx17_h5888daf_1.conda + sha256: 8f91429091183c26950f1e7ffa730e8632f0627ba35d2fccd71df31628c9b4e5 + md5: e1f604644fe8d78e22660e2fec6756bc + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + constrains: + - libabseil-static =20240722.0=cxx17* + - abseil-cpp =20240722.0 + license: Apache-2.0 + license_family: Apache + size: 1310521 + timestamp: 1727295454064 +- kind: conda + name: libabseil + version: '20240722.0' + build: cxx17_hf9b8971_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libabseil-20240722.0-cxx17_hf9b8971_1.conda + sha256: 90bf08a75506dfcf28a70977da8ab050bcf594cd02abd3a9d84a22c9e8161724 + md5: 706da5e791c569a7b9814877098a6a0a + depends: + - __osx >=11.0 + - libcxx >=17 + constrains: + - libabseil-static =20240722.0=cxx17* + - abseil-cpp =20240722.0 + license: Apache-2.0 + license_family: Apache + size: 1179072 + timestamp: 1727295571173 +- kind: conda + name: libarrow + version: 18.0.0 + build: h445c139_4_cpu + build_number: 4 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libarrow-18.0.0-h445c139_4_cpu.conda + sha256: e796f195732847dee89398d6ce1e8480c62e3892763ac328cf03051089b61858 + md5: c2cfd025518472a91b6f38d9c361c00e + depends: + - __osx >=11.0 + - aws-crt-cpp >=0.29.3,<0.29.4.0a0 + - aws-sdk-cpp >=1.11.407,<1.11.408.0a0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - azure-identity-cpp >=1.10.0,<1.10.1.0a0 + - azure-storage-blobs-cpp >=12.13.0,<12.13.1.0a0 + - azure-storage-files-datalake-cpp >=12.12.0,<12.12.1.0a0 + - bzip2 >=1.0.8,<2.0a0 + - glog >=0.7.1,<0.8.0a0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libbrotlidec >=1.1.0,<1.2.0a0 + - libbrotlienc >=1.1.0,<1.2.0a0 + - libcxx >=18 + - libgoogle-cloud >=2.31.0,<2.32.0a0 + - libgoogle-cloud-storage >=2.31.0,<2.32.0a0 + - libre2-11 >=2024.7.2 + - libutf8proc >=2.8.0,<3.0a0 + - libzlib >=1.3.1,<2.0a0 + - lz4-c >=1.9.3,<1.10.0a0 + - orc >=2.0.2,<2.0.3.0a0 + - re2 + - snappy >=1.2.1,<1.3.0a0 + - zstd >=1.5.6,<1.6.0a0 + - libutf8proc <2.9 + constrains: + - parquet-cpp <0.0a0 + - arrow-cpp <0.0a0 + - apache-arrow-proc =*=cpu + license: Apache-2.0 + license_family: APACHE + size: 5434029 + timestamp: 1731271743754 +- kind: conda + name: libarrow + version: 18.1.0 + build: h44a453e_6_cpu + build_number: 6 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libarrow-18.1.0-h44a453e_6_cpu.conda + sha256: abf17e99b03356a9d6248e965826c1352ff01b00d3a62cc51393bb0744d72803 + md5: 2cf6d608d6e66506f69797d5c6944c35 + depends: + - __glibc >=2.17,<3.0.a0 + - aws-crt-cpp >=0.29.7,<0.29.8.0a0 + - aws-sdk-cpp >=1.11.458,<1.11.459.0a0 + - azure-core-cpp >=1.14.0,<1.14.1.0a0 + - azure-identity-cpp >=1.10.0,<1.10.1.0a0 + - azure-storage-blobs-cpp >=12.13.0,<12.13.1.0a0 + - azure-storage-files-datalake-cpp >=12.12.0,<12.12.1.0a0 + - bzip2 >=1.0.8,<2.0a0 + - gflags >=2.2.2,<2.3.0a0 + - glog >=0.7.1,<0.8.0a0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libbrotlidec >=1.1.0,<1.2.0a0 + - libbrotlienc >=1.1.0,<1.2.0a0 + - libgcc >=13 + - libgoogle-cloud >=2.32.0,<2.33.0a0 + - libgoogle-cloud-storage >=2.32.0,<2.33.0a0 + - libre2-11 >=2024.7.2 + - libstdcxx >=13 + - libutf8proc >=2.9.0,<2.10.0a0 + - libzlib >=1.3.1,<2.0a0 + - lz4-c >=1.10.0,<1.11.0a0 + - orc >=2.0.3,<2.0.4.0a0 + - re2 + - snappy >=1.2.1,<1.3.0a0 + - zstd >=1.5.6,<1.6.0a0 + constrains: + - parquet-cpp <0.0a0 + - arrow-cpp <0.0a0 + - apache-arrow-proc =*=cpu + license: Apache-2.0 + license_family: APACHE + size: 8786061 + timestamp: 1733810643966 +- kind: conda + name: libarrow-acero + version: 18.0.0 + build: h286801f_4_cpu + build_number: 4 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libarrow-acero-18.0.0-h286801f_4_cpu.conda + sha256: 3fbdada2e91b41f0f65bd5578f1c87e861cbec7b6162aaec95c9a358331e281b + md5: 9faed7051340e8680ad0c87d26276cad + depends: + - __osx >=11.0 + - libarrow 18.0.0 h445c139_4_cpu + - libcxx >=18 + license: Apache-2.0 + license_family: APACHE + size: 491587 + timestamp: 1731271848730 +- kind: conda + name: libarrow-acero + version: 18.1.0 + build: hcb10f89_6_cpu + build_number: 6 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libarrow-acero-18.1.0-hcb10f89_6_cpu.conda + sha256: a32fa1d71415afc02b5cf3cd4c0a6ec0af9e749308829cc65ff79689222ce479 + md5: 143f9288b64759a6427563f058c62f2b + depends: + - __glibc >=2.17,<3.0.a0 + - libarrow 18.1.0 h44a453e_6_cpu + - libgcc >=13 + - libstdcxx >=13 + license: Apache-2.0 + license_family: APACHE + size: 611745 + timestamp: 1733810698469 +- kind: conda + name: libarrow-dataset + version: 18.0.0 + build: h286801f_4_cpu + build_number: 4 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libarrow-dataset-18.0.0-h286801f_4_cpu.conda + sha256: 1e406c96acf0532be5efcb6cdbbf0c73235bb2549a8dab90fb817d712fd0c033 + md5: 224310b8e7b1c7670c0a7f34c3a52b00 + depends: + - __osx >=11.0 + - libarrow 18.0.0 h445c139_4_cpu + - libarrow-acero 18.0.0 h286801f_4_cpu + - libcxx >=18 + - libparquet 18.0.0 hda0ea68_4_cpu + license: Apache-2.0 + license_family: APACHE + size: 497439 + timestamp: 1731272956870 +- kind: conda + name: libarrow-dataset + version: 18.1.0 + build: hcb10f89_6_cpu + build_number: 6 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libarrow-dataset-18.1.0-hcb10f89_6_cpu.conda + sha256: 74eeb178070002842d3ed721769399320e3a68a0843319eaf899a092a31def26 + md5: 20ca46a6bc714a6ab189d5b3f46e66d8 + depends: + - __glibc >=2.17,<3.0.a0 + - libarrow 18.1.0 h44a453e_6_cpu + - libarrow-acero 18.1.0 hcb10f89_6_cpu + - libgcc >=13 + - libparquet 18.1.0 h081d1f1_6_cpu + - libstdcxx >=13 + license: Apache-2.0 + license_family: APACHE + size: 586627 + timestamp: 1733810842604 +- kind: conda + name: libarrow-substrait + version: 18.0.0 + build: h6a6e5c5_4_cpu + build_number: 4 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libarrow-substrait-18.0.0-h6a6e5c5_4_cpu.conda + sha256: 19e74e87b130a5d176d462f610d406c2b77111d0995578809541ec76053cf3d2 + md5: cf2e497fae56f500c2e33e841c5f8e63 + depends: + - __osx >=11.0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libarrow 18.0.0 h445c139_4_cpu + - libarrow-acero 18.0.0 h286801f_4_cpu + - libarrow-dataset 18.0.0 h286801f_4_cpu + - libcxx >=18 + - libprotobuf >=5.28.2,<5.28.3.0a0 + license: Apache-2.0 + license_family: APACHE + size: 459878 + timestamp: 1731273100637 +- kind: conda + name: libarrow-substrait + version: 18.1.0 + build: h3ee7192_6_cpu + build_number: 6 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libarrow-substrait-18.1.0-h3ee7192_6_cpu.conda + sha256: bda6728db019dd0c409b1996ad9ef6ab0bcee3a94dc66a8045e8c1049c566055 + md5: aa313b3168caf98d00b3753f5ba27650 + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libarrow 18.1.0 h44a453e_6_cpu + - libarrow-acero 18.1.0 hcb10f89_6_cpu + - libarrow-dataset 18.1.0 hcb10f89_6_cpu + - libgcc >=13 + - libprotobuf >=5.28.2,<5.28.3.0a0 + - libstdcxx >=13 + license: Apache-2.0 + license_family: APACHE + size: 519989 + timestamp: 1733810903274 +- kind: conda + name: libblas + version: 3.9.0 + build: 25_linux64_openblas + build_number: 25 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-25_linux64_openblas.conda + sha256: d6d12dc437d060f838820e9e61bf73baab651f91935ac594cf10beb9ef1b4450 + md5: 8ea26d42ca88ec5258802715fe1ee10b + depends: + - libopenblas >=0.3.28,<0.3.29.0a0 + - libopenblas >=0.3.28,<1.0a0 + constrains: + - liblapack 3.9.0 25_linux64_openblas + - libcblas 3.9.0 25_linux64_openblas + - blas * openblas + - liblapacke 3.9.0 25_linux64_openblas + license: BSD-3-Clause + license_family: BSD + size: 15677 + timestamp: 1729642900350 +- kind: conda + name: libblas + version: 3.9.0 + build: 25_osxarm64_openblas + build_number: 25 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libblas-3.9.0-25_osxarm64_openblas.conda + sha256: f1fb9a11af0b2878bd8804b4c77d3733c40076218bcbdb35f575b1c0c9fddf11 + md5: f8cf4d920ff36ce471619010eff59cac + depends: + - libopenblas >=0.3.28,<0.3.29.0a0 + - libopenblas >=0.3.28,<1.0a0 + constrains: + - blas * openblas + - liblapack 3.9.0 25_osxarm64_openblas + - liblapacke 3.9.0 25_osxarm64_openblas + - libcblas 3.9.0 25_osxarm64_openblas + license: BSD-3-Clause + license_family: BSD + size: 15913 + timestamp: 1729643265495 +- kind: conda + name: libbrotlicommon + version: 1.1.0 + build: hb9d3cd8_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.1.0-hb9d3cd8_2.conda + sha256: d9db2de60ea917298e658143354a530e9ca5f9c63471c65cf47ab39fd2f429e3 + md5: 41b599ed2b02abcfdd84302bff174b23 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 68851 + timestamp: 1725267660471 +- kind: conda + name: libbrotlicommon + version: 1.1.0 + build: hd74edd7_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libbrotlicommon-1.1.0-hd74edd7_2.conda + sha256: 839dacb741bdbb25e58f42088a2001b649f4f12195aeb700b5ddfca3267749e5 + md5: d0bf1dff146b799b319ea0434b93f779 + depends: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 68426 + timestamp: 1725267943211 +- kind: conda + name: libbrotlidec + version: 1.1.0 + build: hb9d3cd8_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.1.0-hb9d3cd8_2.conda + sha256: 2892d512cad096cb03f1b66361deeab58b64e15ba525d6592bb6d609e7045edf + md5: 9566f0bd264fbd463002e759b8a82401 + depends: + - __glibc >=2.17,<3.0.a0 + - libbrotlicommon 1.1.0 hb9d3cd8_2 + - libgcc >=13 + license: MIT + license_family: MIT + size: 32696 + timestamp: 1725267669305 +- kind: conda + name: libbrotlidec + version: 1.1.0 + build: hd74edd7_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libbrotlidec-1.1.0-hd74edd7_2.conda + sha256: 6c6862eb274f21a7c0b60e5345467a12e6dda8b9af4438c66d496a2c1a538264 + md5: 55e66e68ce55523a6811633dd1ac74e2 + depends: + - __osx >=11.0 + - libbrotlicommon 1.1.0 hd74edd7_2 + license: MIT + license_family: MIT + size: 28378 + timestamp: 1725267980316 +- kind: conda + name: libbrotlienc + version: 1.1.0 + build: hb9d3cd8_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.1.0-hb9d3cd8_2.conda + sha256: 779f58174e99de3600e939fa46eddb453ec5d3c60bb46cdaa8b4c127224dbf29 + md5: 06f70867945ea6a84d35836af780f1de + depends: + - __glibc >=2.17,<3.0.a0 + - libbrotlicommon 1.1.0 hb9d3cd8_2 + - libgcc >=13 + license: MIT + license_family: MIT + size: 281750 + timestamp: 1725267679782 +- kind: conda + name: libbrotlienc + version: 1.1.0 + build: hd74edd7_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libbrotlienc-1.1.0-hd74edd7_2.conda + sha256: eeb1eb0d58b9d02bc1b98dc0a058f104ab168eb2f7d1c7bfa0570a12cfcdb7b7 + md5: 4f3a434504c67b2c42565c0b85c1885c + depends: + - __osx >=11.0 + - libbrotlicommon 1.1.0 hd74edd7_2 + license: MIT + license_family: MIT + size: 279644 + timestamp: 1725268003553 +- kind: conda + name: libcblas + version: 3.9.0 + build: 25_linux64_openblas + build_number: 25 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-25_linux64_openblas.conda + sha256: ab87b0477078837c91d9cda62a9faca18fba7c57cc77aa779ae24b3ac783b5dd + md5: 5dbd1b0fc0d01ec5e0e1fbe667281a11 + depends: + - libblas 3.9.0 25_linux64_openblas + constrains: + - liblapack 3.9.0 25_linux64_openblas + - blas * openblas + - liblapacke 3.9.0 25_linux64_openblas + license: BSD-3-Clause + license_family: BSD + size: 15613 + timestamp: 1729642905619 +- kind: conda + name: libcblas + version: 3.9.0 + build: 25_osxarm64_openblas + build_number: 25 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libcblas-3.9.0-25_osxarm64_openblas.conda + sha256: d9fa5b6b11252132a3383bbf87bd2f1b9d6248bef1b7e113c2a8ae41b0376218 + md5: 4df0fae81f0b5bf47d48c882b086da11 + depends: + - libblas 3.9.0 25_osxarm64_openblas + constrains: + - blas * openblas + - liblapack 3.9.0 25_osxarm64_openblas + - liblapacke 3.9.0 25_osxarm64_openblas + license: BSD-3-Clause + license_family: BSD + size: 15837 + timestamp: 1729643270793 +- kind: conda + name: libcrc32c + version: 1.1.2 + build: h9c3ff4c_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libcrc32c-1.1.2-h9c3ff4c_0.tar.bz2 + sha256: fd1d153962764433fe6233f34a72cdeed5dcf8a883a85769e8295ce940b5b0c5 + md5: c965a5aa0d5c1c37ffc62dff36e28400 + depends: + - libgcc-ng >=9.4.0 + - libstdcxx-ng >=9.4.0 + license: BSD-3-Clause + license_family: BSD + size: 20440 + timestamp: 1633683576494 +- kind: conda + name: libcrc32c + version: 1.1.2 + build: hbdafb3b_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libcrc32c-1.1.2-hbdafb3b_0.tar.bz2 + sha256: 58477b67cc719060b5b069ba57161e20ba69b8695d154a719cb4b60caf577929 + md5: 32bd82a6a625ea6ce090a81c3d34edeb + depends: + - libcxx >=11.1.0 + license: BSD-3-Clause + license_family: BSD + size: 18765 + timestamp: 1633683992603 +- kind: conda + name: libcurl + version: 8.10.1 + build: h13a7ad3_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libcurl-8.10.1-h13a7ad3_0.conda + sha256: 983a977c5627f975a930542c8aabb46089ec6ea72f28d9c4d3ee8eafaf2fc25a + md5: d84030d0863ffe7dea00b9a807fee961 + depends: + - __osx >=11.0 + - krb5 >=1.21.3,<1.22.0a0 + - libnghttp2 >=1.58.0,<2.0a0 + - libssh2 >=1.11.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + - zstd >=1.5.6,<1.6.0a0 + license: curl + license_family: MIT + size: 379948 + timestamp: 1726660033582 +- kind: conda + name: libcurl + version: 8.11.1 + build: h332b0f4_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.11.1-h332b0f4_0.conda + sha256: 3cd4075b2a7b5562e46c8ec626f6f9ca57aeecaa94ff7df57eca26daa94c9906 + md5: 2b3e0081006dc21e8bf53a91c83a055c + depends: + - __glibc >=2.17,<3.0.a0 + - krb5 >=1.21.3,<1.22.0a0 + - libgcc >=13 + - libnghttp2 >=1.64.0,<2.0a0 + - libssh2 >=1.11.1,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.4.0,<4.0a0 + - zstd >=1.5.6,<1.6.0a0 + license: curl + license_family: MIT + size: 423011 + timestamp: 1733999897624 +- kind: conda + name: libcxx + version: 19.1.3 + build: ha82da77_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libcxx-19.1.3-ha82da77_0.conda + sha256: 6d062760c6439e75b9a44d800d89aff60fe3441998d87506c62dc94c50412ef4 + md5: bf691071fba4734984231617783225bc + depends: + - __osx >=11.0 + license: Apache-2.0 WITH LLVM-exception + license_family: Apache + size: 520771 + timestamp: 1730314603920 +- kind: conda + name: libdeflate + version: '1.23' + build: h4ddbbb0_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.23-h4ddbbb0_0.conda + sha256: 511d801626d02f4247a04fff957cc6e9ec4cc7e8622bd9acd076bcdc5de5fe66 + md5: 8dfae1d2e74767e9ce36d5fa0d8605db + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 72255 + timestamp: 1734373823254 +- kind: conda + name: libdeflate + version: '1.23' + build: hec38601_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libdeflate-1.23-hec38601_0.conda + sha256: 887c02deaed6d583459eba6367023e36d8761085b2f7126e389424f57155da53 + md5: 1d8b9588be14e71df38c525767a1ac30 + depends: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 54132 + timestamp: 1734373971372 +- kind: conda + name: libedit + version: 3.1.20191231 + build: hc8eb9b7_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libedit-3.1.20191231-hc8eb9b7_2.tar.bz2 + sha256: 3912636197933ecfe4692634119e8644904b41a58f30cad9d1fc02f6ba4d9fca + md5: 30e4362988a2623e9eb34337b83e01f9 + depends: + - ncurses >=6.2,<7.0.0a0 + license: BSD-2-Clause + license_family: BSD + size: 96607 + timestamp: 1597616630749 +- kind: conda + name: libedit + version: 3.1.20191231 + build: he28a2e2_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2 + sha256: a57d37c236d8f7c886e01656f4949d9dcca131d2a0728609c6f7fa338b65f1cf + md5: 4d331e44109e3f0e19b4cb8f9b82f3e1 + depends: + - libgcc-ng >=7.5.0 + - ncurses >=6.2,<7.0.0a0 + license: BSD-2-Clause + license_family: BSD + size: 123878 + timestamp: 1597616541093 +- kind: conda + name: libev + version: '4.33' + build: h93a5062_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libev-4.33-h93a5062_2.conda + sha256: 95cecb3902fbe0399c3a7e67a5bed1db813e5ab0e22f4023a5e0f722f2cc214f + md5: 36d33e440c31857372a72137f78bacf5 + license: BSD-2-Clause + license_family: BSD + size: 107458 + timestamp: 1702146414478 +- kind: conda + name: libev + version: '4.33' + build: hd590300_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda + sha256: 1cd6048169fa0395af74ed5d8f1716e22c19a81a8a36f934c110ca3ad4dd27b4 + md5: 172bf1cd1ff8629f2b1179945ed45055 + depends: + - libgcc-ng >=12 + license: BSD-2-Clause + license_family: BSD + size: 112766 + timestamp: 1702146165126 +- kind: conda + name: libevent + version: 2.1.12 + build: h2757513_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libevent-2.1.12-h2757513_1.conda + sha256: 8c136d7586259bb5c0d2b913aaadc5b9737787ae4f40e3ad1beaf96c80b919b7 + md5: 1a109764bff3bdc7bdd84088347d71dc + depends: + - openssl >=3.1.1,<4.0a0 + license: BSD-3-Clause + license_family: BSD + size: 368167 + timestamp: 1685726248899 +- kind: conda + name: libevent + version: 2.1.12 + build: hf998b51_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libevent-2.1.12-hf998b51_1.conda + sha256: 2e14399d81fb348e9d231a82ca4d816bf855206923759b69ad006ba482764131 + md5: a1cfcc585f0c42bf8d5546bb1dfb668d + depends: + - libgcc-ng >=12 + - openssl >=3.1.1,<4.0a0 + license: BSD-3-Clause + license_family: BSD + size: 427426 + timestamp: 1685725977222 +- kind: conda + name: libexpat + version: 2.6.3 + build: h5888daf_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.3-h5888daf_0.conda + sha256: 4bb47bb2cd09898737a5211e2992d63c555d63715a07ba56eae0aff31fb89c22 + md5: 59f4c43bb1b5ef1c71946ff2cbf59524 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + constrains: + - expat 2.6.3.* + license: MIT + license_family: MIT + size: 73616 + timestamp: 1725568742634 +- kind: conda + name: libexpat + version: 2.6.3 + build: hf9b8971_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libexpat-2.6.3-hf9b8971_0.conda + sha256: 5cbe5a199fba14ade55457a468ce663aac0b54832c39aa54470b3889b4c75c4a + md5: 5f22f07c2ab2dea8c66fe9585a062c96 + depends: + - __osx >=11.0 + constrains: + - expat 2.6.3.* + license: MIT + license_family: MIT + size: 63895 + timestamp: 1725568783033 +- kind: conda + name: libffi + version: 3.4.2 + build: h3422bc3_5 + build_number: 5 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.4.2-h3422bc3_5.tar.bz2 + sha256: 41b3d13efb775e340e4dba549ab5c029611ea6918703096b2eaa9c015c0750ca + md5: 086914b672be056eb70fd4285b6783b6 + license: MIT + license_family: MIT + size: 39020 + timestamp: 1636488587153 +- kind: conda + name: libffi + version: 3.4.2 + build: h7f98852_5 + build_number: 5 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2 + sha256: ab6e9856c21709b7b517e940ae7028ae0737546122f83c2aa5d692860c3b149e + md5: d645c6d2ac96843a2bfaccd2d62b3ac3 + depends: + - libgcc-ng >=9.4.0 + license: MIT + license_family: MIT + size: 58292 + timestamp: 1636488182923 +- kind: conda + name: libgcc + version: 14.2.0 + build: h77fa898_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda + sha256: 53eb8a79365e58849e7b1a068d31f4f9e718dc938d6f2c03e960345739a03569 + md5: 3cb76c3f10d3bc7f1105b2fc9db984df + depends: + - _libgcc_mutex 0.1 conda_forge + - _openmp_mutex >=4.5 + constrains: + - libgomp 14.2.0 h77fa898_1 + - libgcc-ng ==14.2.0=*_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 848745 + timestamp: 1729027721139 +- kind: conda + name: libgcc-ng + version: 14.2.0 + build: h69a702a_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.2.0-h69a702a_1.conda + sha256: 3a76969c80e9af8b6e7a55090088bc41da4cffcde9e2c71b17f44d37b7cb87f7 + md5: e39480b9ca41323497b05492a63bc35b + depends: + - libgcc 14.2.0 h77fa898_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 54142 + timestamp: 1729027726517 +- kind: conda + name: libgfortran + version: 5.0.0 + build: 13_2_0_hd922786_3 + build_number: 3 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libgfortran-5.0.0-13_2_0_hd922786_3.conda + sha256: 44e541b4821c96b28b27fef5630883a60ce4fee91fd9c79f25a199f8f73f337b + md5: 4a55d9e169114b2b90d3ec4604cd7bbf + depends: + - libgfortran5 13.2.0 hf226fd6_3 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 110233 + timestamp: 1707330749033 +- kind: conda + name: libgfortran + version: 14.2.0 + build: h69a702a_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-14.2.0-h69a702a_1.conda + sha256: fc9e7f22a17faf74da904ebfc4d88699013d2992e55505e4aa0eb01770290977 + md5: f1fd30127802683586f768875127a987 + depends: + - libgfortran5 14.2.0 hd5240d6_1 + constrains: + - libgfortran-ng ==14.2.0=*_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 53997 + timestamp: 1729027752995 +- kind: conda + name: libgfortran-ng + version: 14.2.0 + build: h69a702a_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-14.2.0-h69a702a_1.conda + sha256: 423f1e2403f0c665748e42d335e421e53fd03c08d457cfb6f360d329d9459851 + md5: 0a7f4cd238267c88e5d69f7826a407eb + depends: + - libgfortran 14.2.0 h69a702a_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 54106 + timestamp: 1729027945817 +- kind: conda + name: libgfortran5 + version: 13.2.0 + build: hf226fd6_3 + build_number: 3 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libgfortran5-13.2.0-hf226fd6_3.conda + sha256: bafc679eedb468a86aa4636061c55966186399ee0a04b605920d208d97ac579a + md5: 66ac81d54e95c534ae488726c1f698ea + depends: + - llvm-openmp >=8.0.0 + constrains: + - libgfortran 5.0.0 13_2_0_*_3 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 997381 + timestamp: 1707330687590 +- kind: conda + name: libgfortran5 + version: 14.2.0 + build: hd5240d6_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-14.2.0-hd5240d6_1.conda + sha256: d149a37ca73611e425041f33b9d8dbed6e52ec506fe8cc1fc0ee054bddeb6d5d + md5: 9822b874ea29af082e5d36098d25427d + depends: + - libgcc >=14.2.0 + constrains: + - libgfortran 14.2.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 1462645 + timestamp: 1729027735353 +- kind: conda + name: libgomp + version: 14.2.0 + build: h77fa898_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda + sha256: 1911c29975ec99b6b906904040c855772ccb265a1c79d5d75c8ceec4ed89cd63 + md5: cc3573974587f12dda90d96e3e55a702 + depends: + - _libgcc_mutex 0.1 conda_forge + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 460992 + timestamp: 1729027639220 +- kind: conda + name: libgoogle-cloud + version: 2.31.0 + build: h8d8be31_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libgoogle-cloud-2.31.0-h8d8be31_0.conda + sha256: 184d650d55453a40935c128ea309088ae52e15a68cd87ab17ae7c77704251168 + md5: a338736f1514e6f999db8726fe0965b1 + depends: + - __osx >=11.0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libcurl >=8.10.1,<9.0a0 + - libcxx >=18 + - libgrpc >=1.67.1,<1.68.0a0 + - libprotobuf >=5.28.2,<5.28.3.0a0 + - openssl >=3.3.2,<4.0a0 + constrains: + - libgoogle-cloud 2.31.0 *_0 + license: Apache-2.0 + license_family: Apache + size: 873497 + timestamp: 1731121684939 +- kind: conda + name: libgoogle-cloud + version: 2.32.0 + build: h804f50b_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgoogle-cloud-2.32.0-h804f50b_0.conda + sha256: 126856add750013390dff664a3c3cd0f6f0cbbc683b0025a7ce9d1618968bc70 + md5: 3d96df4d6b1c88455e05b94ce8a14a53 + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libcurl >=8.10.1,<9.0a0 + - libgcc >=13 + - libgrpc >=1.67.1,<1.68.0a0 + - libprotobuf >=5.28.2,<5.28.3.0a0 + - libstdcxx >=13 + - openssl >=3.4.0,<4.0a0 + constrains: + - libgoogle-cloud 2.32.0 *_0 + license: Apache-2.0 + license_family: Apache + size: 1249557 + timestamp: 1733512191906 +- kind: conda + name: libgoogle-cloud-storage + version: 2.31.0 + build: h7081f7f_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libgoogle-cloud-storage-2.31.0-h7081f7f_0.conda + sha256: 01f5156584b816d34270a60a61f6b6561f2a01cb3b4eeb455a4e1808d763d486 + md5: 548fd1d31741ee6b13df4124db4a9f5f + depends: + - __osx >=11.0 + - libabseil + - libcrc32c >=1.1.2,<1.2.0a0 + - libcurl + - libcxx >=18 + - libgoogle-cloud 2.31.0 h8d8be31_0 + - libzlib >=1.3.1,<2.0a0 + - openssl + license: Apache-2.0 + license_family: Apache + size: 526858 + timestamp: 1731122580689 +- kind: conda + name: libgoogle-cloud-storage + version: 2.32.0 + build: h0121fbd_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgoogle-cloud-storage-2.32.0-h0121fbd_0.conda + sha256: d1b53d17df38b52a4bc6d1fe6af0e611d6480ce10b0af570c84bd38c8aa83b91 + md5: 877a5ec0431a5af83bf0cd0522bfe661 + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil + - libcrc32c >=1.1.2,<1.2.0a0 + - libcurl + - libgcc >=13 + - libgoogle-cloud 2.32.0 h804f50b_0 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl + license: Apache-2.0 + license_family: Apache + size: 782108 + timestamp: 1733512329104 +- kind: conda + name: libgrpc + version: 1.67.1 + build: hc2c308b_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgrpc-1.67.1-hc2c308b_0.conda + sha256: 870550c1faf524e9a695262cd4c31441b18ad542f16893bd3c5dbc93106705f7 + md5: 4606a4647bfe857e3cfe21ca12ac3afb + depends: + - __glibc >=2.17,<3.0.a0 + - c-ares >=1.32.3,<2.0a0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libgcc >=13 + - libprotobuf >=5.28.2,<5.28.3.0a0 + - libre2-11 >=2024.7.2 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + - re2 + constrains: + - grpc-cpp =1.67.1 + license: Apache-2.0 + license_family: APACHE + size: 7362336 + timestamp: 1730236333879 +- kind: conda + name: libgrpc + version: 1.67.1 + build: hc70892a_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libgrpc-1.67.1-hc70892a_0.conda + sha256: d2393fcd3c3584e5d58da4122f48bcf297567d2f6f14b3d1fcbd34fdd5040694 + md5: 624e27571fde34f8acc2afec840ac435 + depends: + - __osx >=11.0 + - c-ares >=1.34.2,<2.0a0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libcxx >=17 + - libprotobuf >=5.28.2,<5.28.3.0a0 + - libre2-11 >=2024.7.2 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + - re2 + constrains: + - grpc-cpp =1.67.1 + license: Apache-2.0 + license_family: APACHE + size: 4882208 + timestamp: 1730236299095 +- kind: conda + name: libiconv + version: '1.17' + build: h0d3ecfb_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libiconv-1.17-h0d3ecfb_2.conda + sha256: bc7de5097b97bcafcf7deaaed505f7ce02f648aac8eccc0d5a47cc599a1d0304 + md5: 69bda57310071cf6d2b86caf11573d2d + license: LGPL-2.1-only + size: 676469 + timestamp: 1702682458114 +- kind: conda + name: libiconv + version: '1.17' + build: hd590300_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda + sha256: 8ac2f6a9f186e76539439e50505d98581472fedb347a20e7d1f36429849f05c9 + md5: d66573916ffcf376178462f1b61c941e + depends: + - libgcc-ng >=12 + license: LGPL-2.1-only + size: 705775 + timestamp: 1702682170569 +- kind: conda + name: libjpeg-turbo + version: 3.0.0 + build: hb547adb_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libjpeg-turbo-3.0.0-hb547adb_1.conda + sha256: a42054eaa38e84fc1e5ab443facac4bbc9d1b6b6f23f54b7bf4f1eb687e1d993 + md5: 3ff1e053dc3a2b8e36b9bfa4256a58d1 + constrains: + - jpeg <0.0.0a + license: IJG AND BSD-3-Clause AND Zlib + size: 547541 + timestamp: 1694475104253 +- kind: conda + name: libjpeg-turbo + version: 3.0.0 + build: hd590300_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.0.0-hd590300_1.conda + sha256: b954e09b7e49c2f2433d6f3bb73868eda5e378278b0f8c1dd10a7ef090e14f2f + md5: ea25936bb4080d843790b586850f82b8 + depends: + - libgcc-ng >=12 + constrains: + - jpeg <0.0.0a + license: IJG AND BSD-3-Clause AND Zlib + size: 618575 + timestamp: 1694474974816 +- kind: conda + name: liblapack + version: 3.9.0 + build: 25_linux64_openblas + build_number: 25 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-25_linux64_openblas.conda + sha256: 9d1ff017714edb2d84868f0f931a4a0e7c289a971062b2ac66cfc8145df7e20e + md5: 4dc03a53fc69371a6158d0ed37214cd3 + depends: + - libblas 3.9.0 25_linux64_openblas + constrains: + - liblapacke 3.9.0 25_linux64_openblas + - libcblas 3.9.0 25_linux64_openblas + - blas * openblas + license: BSD-3-Clause + license_family: BSD + size: 15608 + timestamp: 1729642910812 +- kind: conda + name: liblapack + version: 3.9.0 + build: 25_osxarm64_openblas + build_number: 25 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/liblapack-3.9.0-25_osxarm64_openblas.conda + sha256: fdd742407672a9af20e70764550cf18b3ab67f12e48bf04163b90492fbc401e7 + md5: 19bbddfec972d401838330453186108d + depends: + - libblas 3.9.0 25_osxarm64_openblas + constrains: + - blas * openblas + - liblapacke 3.9.0 25_osxarm64_openblas + - libcblas 3.9.0 25_osxarm64_openblas + license: BSD-3-Clause + license_family: BSD + size: 15823 + timestamp: 1729643275943 +- kind: conda + name: liblzma + version: 5.6.3 + build: h39f12f2_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/liblzma-5.6.3-h39f12f2_1.conda + sha256: d863b8257406918ffdc50ae65502f2b2d6cede29404d09a094f59509d6a0aaf1 + md5: b2553114a7f5e20ccd02378a77d836aa + depends: + - __osx >=11.0 + license: 0BSD + size: 99129 + timestamp: 1733407496073 +- kind: conda + name: liblzma + version: 5.6.3 + build: hb9d3cd8_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.6.3-hb9d3cd8_1.conda + sha256: e6e425252f3839e2756e4af1ea2074dffd3396c161bf460629f9dfd6a65f15c6 + md5: 2ecf2f1c7e4e21fcfe6423a51a992d84 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: 0BSD + size: 111132 + timestamp: 1733407410083 +- kind: conda + name: libnghttp2 + version: 1.64.0 + build: h161d5f1_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.64.0-h161d5f1_0.conda + sha256: b0f2b3695b13a989f75d8fd7f4778e1c7aabe3b36db83f0fe80b2cd812c0e975 + md5: 19e57602824042dfd0446292ef90488b + depends: + - __glibc >=2.17,<3.0.a0 + - c-ares >=1.32.3,<2.0a0 + - libev >=4.33,<4.34.0a0 + - libev >=4.33,<5.0a0 + - libgcc >=13 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: MIT + license_family: MIT + size: 647599 + timestamp: 1729571887612 +- kind: conda + name: libnghttp2 + version: 1.64.0 + build: h6d7220d_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libnghttp2-1.64.0-h6d7220d_0.conda + sha256: 00cc685824f39f51be5233b54e19f45abd60de5d8847f1a56906f8936648b72f + md5: 3408c02539cee5f1141f9f11450b6a51 + depends: + - __osx >=11.0 + - c-ares >=1.34.2,<2.0a0 + - libcxx >=17 + - libev >=4.33,<4.34.0a0 + - libev >=4.33,<5.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: MIT + license_family: MIT + size: 566719 + timestamp: 1729572385640 +- kind: conda + name: libnsl + version: 2.0.1 + build: hd590300_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hd590300_0.conda + sha256: 26d77a3bb4dceeedc2a41bd688564fe71bf2d149fdcf117049970bc02ff1add6 + md5: 30fd6e37fe21f86f4bd26d6ee73eeec7 + depends: + - libgcc-ng >=12 + license: LGPL-2.1-only + license_family: GPL + size: 33408 + timestamp: 1697359010159 +- kind: conda + name: libopenblas + version: 0.3.28 + build: openmp_h517c56d_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libopenblas-0.3.28-openmp_h517c56d_0.conda + sha256: 43d69d072f1a3774994d31f9d3241cfa0f1c5560b536989020d7cde30fbef956 + md5: 9306fd5b6b39b2b7e13c1d50c3fee354 + depends: + - __osx >=11.0 + - libgfortran 5.* + - libgfortran5 >=12.3.0 + - llvm-openmp >=16.0.6 + constrains: + - openblas >=0.3.28,<0.3.29.0a0 + license: BSD-3-Clause + license_family: BSD + size: 2934061 + timestamp: 1723931625423 +- kind: conda + name: libopenblas + version: 0.3.28 + build: pthreads_h94d23a6_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.28-pthreads_h94d23a6_0.conda + sha256: 1e41a6d63e07be996238a1e840a426f86068956a45e0c0bb24e49a8dad9874c1 + md5: 9ebc9aedafaa2515ab247ff6bb509458 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc-ng >=14 + - libgfortran-ng + - libgfortran5 >=14.1.0 + constrains: + - openblas >=0.3.28,<0.3.29.0a0 + license: BSD-3-Clause + license_family: BSD + size: 5572213 + timestamp: 1723932528810 +- kind: conda + name: libparquet + version: 18.0.0 + build: hda0ea68_4_cpu + build_number: 4 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libparquet-18.0.0-hda0ea68_4_cpu.conda + sha256: 3d479eabfc82301bee879df47dd8a30907a013690ac2356189bb70c3a07876b3 + md5: 3c15186e379de4ef46d0bb8f9780ba91 + depends: + - __osx >=11.0 + - libarrow 18.0.0 h445c139_4_cpu + - libcxx >=18 + - libthrift >=0.21.0,<0.21.1.0a0 + - openssl >=3.3.2,<4.0a0 + license: Apache-2.0 + license_family: APACHE + size: 881973 + timestamp: 1731272895924 +- kind: conda + name: libparquet + version: 18.1.0 + build: h081d1f1_6_cpu + build_number: 6 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libparquet-18.1.0-h081d1f1_6_cpu.conda + sha256: c691a59f1ebb6cedbf827f49f6cf414e08b0eec911f589133e6a8321e8ac701c + md5: 68788df49ce7480187eb6387f15b2b67 + depends: + - __glibc >=2.17,<3.0.a0 + - libarrow 18.1.0 h44a453e_6_cpu + - libgcc >=13 + - libstdcxx >=13 + - libthrift >=0.21.0,<0.21.1.0a0 + - openssl >=3.4.0,<4.0a0 + license: Apache-2.0 + license_family: APACHE + size: 1204535 + timestamp: 1733810811118 +- kind: conda + name: libpng + version: 1.6.44 + build: hadc24fc_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.44-hadc24fc_0.conda + sha256: e5b14f7a01c2db4362d8591f42f82f336ed48d5e4079e4d1f65d0c2a3637ea78 + md5: f4cc49d7aa68316213e4b12be35308d1 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libzlib >=1.3.1,<2.0a0 + license: zlib-acknowledgement + size: 290661 + timestamp: 1726234747153 +- kind: conda + name: libpng + version: 1.6.44 + build: hc14010f_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libpng-1.6.44-hc14010f_0.conda + sha256: 38f8759a3eb8060deabd4db41f0f023514d853e46ddcbd0ba21768fc4e563bb1 + md5: fb36e93f0ea6a6f5d2b99984f34b049e + depends: + - __osx >=11.0 + - libzlib >=1.3.1,<2.0a0 + license: zlib-acknowledgement + size: 263385 + timestamp: 1726234714421 +- kind: conda + name: libprotobuf + version: 5.28.2 + build: h5b01275_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libprotobuf-5.28.2-h5b01275_0.conda + sha256: 5e8fd4aa00193c85602ce6101dd28fe31306dff85c9725048f6dc828dfa7c421 + md5: ab0bff36363bec94720275a681af8b83 + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libgcc >=13 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + size: 2945348 + timestamp: 1728565355702 +- kind: conda + name: libprotobuf + version: 5.28.2 + build: h8f0b736_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libprotobuf-5.28.2-h8f0b736_0.conda + sha256: f732a6fa918428e2d5ba61e78fe11bb44a002cc8f6bb74c94ee5b1297fefcfd8 + md5: d2cb5991f2fb8eb079c80084435e9ce6 + depends: + - __osx >=11.0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libcxx >=17 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + size: 2374965 + timestamp: 1728565334796 +- kind: conda + name: libre2-11 + version: 2024.07.02 + build: h2348fd5_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libre2-11-2024.07.02-h2348fd5_1.conda + sha256: 6facca42cfc85a05b33e484a8b0df7857cc092db34806946d022270098d8d20f + md5: 5a7065309a66097738be6a06fd04b7ef + depends: + - __osx >=11.0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libcxx >=17 + constrains: + - re2 2024.07.02.* + license: BSD-3-Clause + license_family: BSD + size: 165956 + timestamp: 1728779107218 +- kind: conda + name: libre2-11 + version: 2024.07.02 + build: hbbce691_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libre2-11-2024.07.02-hbbce691_1.conda + sha256: f8ad6a4f6d4fd54ebe3e5e712a01e663222fc57f49d16b6b8b10c30990dafb8f + md5: 2124de47357b7a516c0a3efd8f88c143 + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil * cxx17* + - libabseil >=20240722.0,<20240723.0a0 + - libgcc >=13 + - libstdcxx >=13 + constrains: + - re2 2024.07.02.* + license: BSD-3-Clause + license_family: BSD + size: 211096 + timestamp: 1728778964655 +- kind: conda + name: libsodium + version: 1.0.20 + build: h4ab18f5_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libsodium-1.0.20-h4ab18f5_0.conda + sha256: 0105bd108f19ea8e6a78d2d994a6d4a8db16d19a41212070d2d1d48a63c34161 + md5: a587892d3c13b6621a6091be690dbca2 + depends: + - libgcc-ng >=12 + license: ISC + size: 205978 + timestamp: 1716828628198 +- kind: conda + name: libsodium + version: 1.0.20 + build: h99b78c6_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libsodium-1.0.20-h99b78c6_0.conda + sha256: fade8223e1e1004367d7101dd17261003b60aa576df6d7802191f8972f7470b1 + md5: a7ce36e284c5faaf93c220dfc39e3abd + depends: + - __osx >=11.0 + license: ISC + size: 164972 + timestamp: 1716828607917 +- kind: conda + name: libsqlite + version: 3.47.0 + build: hadc24fc_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.47.0-hadc24fc_1.conda + sha256: 8a9aadf996a2399f65b679c6e7f29139d5059f699c63e6d7b50e20db10c00508 + md5: b6f02b52a174e612e89548f4663ce56a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libzlib >=1.3.1,<2.0a0 + license: Unlicense + size: 875349 + timestamp: 1730208050020 +- kind: conda + name: libsqlite + version: 3.47.0 + build: hbaaea75_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.47.0-hbaaea75_1.conda + sha256: 5a96caa566c11e5a5ebdcdb86a0759a7fb27d3c5f42e6a0fd0d6023c1e935d9e + md5: 07a14fbe439eef078cc479deca321161 + depends: + - __osx >=11.0 + - libzlib >=1.3.1,<2.0a0 + license: Unlicense + size: 837683 + timestamp: 1730208293578 +- kind: conda + name: libssh2 + version: 1.11.0 + build: h7a5bd25_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libssh2-1.11.0-h7a5bd25_0.conda + sha256: bb57d0c53289721fff1eeb3103a1c6a988178e88d8a8f4345b0b91a35f0e0015 + md5: 029f7dc931a3b626b94823bc77830b01 + depends: + - libzlib >=1.2.13,<2.0.0a0 + - openssl >=3.1.1,<4.0a0 + license: BSD-3-Clause + license_family: BSD + size: 255610 + timestamp: 1685837894256 +- kind: conda + name: libssh2 + version: 1.11.1 + build: hf672d98_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.1-hf672d98_0.conda + sha256: 0407ac9fda2bb67e11e357066eff144c845801d00b5f664efbc48813af1e7bb9 + md5: be2de152d8073ef1c01b7728475f2fe7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.4.0,<4.0a0 + license: BSD-3-Clause + license_family: BSD + size: 304278 + timestamp: 1732349402869 +- kind: conda + name: libstdcxx + version: 14.2.0 + build: hc0a3c3a_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-14.2.0-hc0a3c3a_1.conda + sha256: 4661af0eb9bdcbb5fb33e5d0023b001ad4be828fccdcc56500059d56f9869462 + md5: 234a5554c53625688d51062645337328 + depends: + - libgcc 14.2.0 h77fa898_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 3893695 + timestamp: 1729027746910 +- kind: conda + name: libstdcxx-ng + version: 14.2.0 + build: h4852527_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.2.0-h4852527_1.conda + sha256: 25bb30b827d4f6d6f0522cc0579e431695503822f144043b93c50237017fffd8 + md5: 8371ac6457591af2cf6159439c1fd051 + depends: + - libstdcxx 14.2.0 hc0a3c3a_1 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 54105 + timestamp: 1729027780628 +- kind: conda + name: libthrift + version: 0.21.0 + build: h0e7cc3e_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libthrift-0.21.0-h0e7cc3e_0.conda + sha256: ebb395232973c18745b86c9a399a4725b2c39293c9a91b8e59251be013db42f0 + md5: dcb95c0a98ba9ff737f7ae482aef7833 + depends: + - __glibc >=2.17,<3.0.a0 + - libevent >=2.1.12,<2.1.13.0a0 + - libgcc >=13 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: Apache-2.0 + license_family: APACHE + size: 425773 + timestamp: 1727205853307 +- kind: conda + name: libthrift + version: 0.21.0 + build: h64651cc_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libthrift-0.21.0-h64651cc_0.conda + sha256: 7a6c7d5f58cbbc2ccd6493b4b821639fdb0701b9b04c737a949e8cb6adf1c9ad + md5: 7ce2bd2f650f8c31ad7ba4c7bfea61b7 + depends: + - __osx >=11.0 + - libcxx >=17 + - libevent >=2.1.12,<2.1.13.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.3.2,<4.0a0 + license: Apache-2.0 + license_family: APACHE + size: 324342 + timestamp: 1727206096912 +- kind: conda + name: libtiff + version: 4.7.0 + build: h551f018_3 + build_number: 3 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libtiff-4.7.0-h551f018_3.conda + sha256: 91417846157e04992801438a496b151df89604b2e7c6775d6f701fcd0cbed5ae + md5: a5d084a957563e614ec0c0196d890654 + depends: + - __osx >=11.0 + - lerc >=4.0.0,<5.0a0 + - libcxx >=18 + - libdeflate >=1.23,<1.24.0a0 + - libjpeg-turbo >=3.0.0,<4.0a0 + - liblzma >=5.6.3,<6.0a0 + - libwebp-base >=1.4.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - zstd >=1.5.6,<1.6.0a0 + license: HPND + size: 370600 + timestamp: 1734398863052 +- kind: conda + name: libtiff + version: 4.7.0 + build: hd9ff511_3 + build_number: 3 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.7.0-hd9ff511_3.conda + sha256: b224e16b88d76ea95e4af56e2bc638c603bd26a770b98d117d04541d3aafa002 + md5: 0ea6510969e1296cc19966fad481f6de + depends: + - __glibc >=2.17,<3.0.a0 + - lerc >=4.0.0,<5.0a0 + - libdeflate >=1.23,<1.24.0a0 + - libgcc >=13 + - libjpeg-turbo >=3.0.0,<4.0a0 + - liblzma >=5.6.3,<6.0a0 + - libstdcxx >=13 + - libwebp-base >=1.4.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - zstd >=1.5.6,<1.6.0a0 + license: HPND + size: 428173 + timestamp: 1734398813264 +- kind: conda + name: libutf8proc + version: 2.8.0 + build: hc098a78_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libutf8proc-2.8.0-hc098a78_1.conda + sha256: 7807a98522477a8bf12460402845224f607ab6e1e73ac316b667169f5143cfe5 + md5: ed89b8bf0d74d23ce47bcf566dd36608 + depends: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 82462 + timestamp: 1732829832932 +- kind: conda + name: libutf8proc + version: 2.9.0 + build: hb9d3cd8_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libutf8proc-2.9.0-hb9d3cd8_1.conda + sha256: 9794e6388e780c3310d46f773bbc924d4053375c3fcdb07a704b57f4616db928 + md5: 1e936bd23d737aac62a18e9a1e7f8b18 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 81500 + timestamp: 1732868419835 +- kind: conda + name: libuuid + version: 2.38.1 + build: h0b41bf4_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda + sha256: 787eb542f055a2b3de553614b25f09eefb0a0931b0c87dbcce6efdfd92f04f18 + md5: 40b61aab5c7ba9ff276c41cfffe6b80b + depends: + - libgcc-ng >=12 + license: BSD-3-Clause + license_family: BSD + size: 33601 + timestamp: 1680112270483 +- kind: conda + name: libwebp-base + version: 1.5.0 + build: h2471fea_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libwebp-base-1.5.0-h2471fea_0.conda + sha256: f8bdb876b4bc8cb5df47c28af29188de8911c3fea4b799a33743500149de3f4a + md5: 569466afeb84f90d5bb88c11cc23d746 + depends: + - __osx >=11.0 + constrains: + - libwebp 1.5.0 + license: BSD-3-Clause + size: 290013 + timestamp: 1734777593617 +- kind: conda + name: libwebp-base + version: 1.5.0 + build: h851e524_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.5.0-h851e524_0.conda + sha256: c45283fd3e90df5f0bd3dbcd31f59cdd2b001d424cf30a07223655413b158eaf + md5: 63f790534398730f59e1b899c3644d4a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + constrains: + - libwebp 1.5.0 + license: BSD-3-Clause + size: 429973 + timestamp: 1734777489810 +- kind: conda + name: libxcb + version: 1.17.0 + build: h8a09558_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.17.0-h8a09558_0.conda + sha256: 666c0c431b23c6cec6e492840b176dde533d48b7e6fb8883f5071223433776aa + md5: 92ed62436b625154323d40d5f2f11dd7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - pthread-stubs + - xorg-libxau >=1.0.11,<2.0a0 + - xorg-libxdmcp + license: MIT + license_family: MIT + size: 395888 + timestamp: 1727278577118 +- kind: conda + name: libxcb + version: 1.17.0 + build: hdb1d25a_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libxcb-1.17.0-hdb1d25a_0.conda + sha256: bd3816218924b1e43b275863e21a3e13a5db4a6da74cca8e60bc3c213eb62f71 + md5: af523aae2eca6dfa1c8eec693f5b9a79 + depends: + - __osx >=11.0 + - pthread-stubs + - xorg-libxau >=1.0.11,<2.0a0 + - xorg-libxdmcp + license: MIT + license_family: MIT + size: 323658 + timestamp: 1727278733917 +- kind: conda + name: libxcrypt + version: 4.4.36 + build: hd590300_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda + sha256: 6ae68e0b86423ef188196fff6207ed0c8195dd84273cb5623b85aa08033a410c + md5: 5aa797f8787fe7a17d1b0821485b5adc + depends: + - libgcc-ng >=12 + license: LGPL-2.1-or-later + size: 100393 + timestamp: 1702724383534 +- kind: conda + name: libxml2 + version: 2.13.5 + build: h0d44e9d_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.13.5-h0d44e9d_1.conda + sha256: 306e18aa647d8208ad2cd0e62d84933222b2fbe93d2d53cd5283d2256b1d54de + md5: f5b05674697ae7d2c5932766695945e1 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libiconv >=1.17,<2.0a0 + - liblzma >=5.6.3,<6.0a0 + - libzlib >=1.3.1,<2.0a0 + constrains: + - icu <0.0a0 + license: MIT + license_family: MIT + size: 689993 + timestamp: 1733443678322 +- kind: conda + name: libxml2 + version: 2.13.5 + build: h178c5d8_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libxml2-2.13.5-h178c5d8_1.conda + sha256: d7af3f25a4cece170502acd38f2dafbea4521f373f46dcb28a37fbe6ac2da544 + md5: 3dc3cff0eca1640a6acbbfab2f78139e + depends: + - __osx >=11.0 + - icu >=75.1,<76.0a0 + - libiconv >=1.17,<2.0a0 + - liblzma >=5.6.3,<6.0a0 + - libzlib >=1.3.1,<2.0a0 + license: MIT + license_family: MIT + size: 582898 + timestamp: 1733443841584 +- kind: conda + name: libzlib + version: 1.3.1 + build: h8359307_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.3.1-h8359307_2.conda + sha256: ce34669eadaba351cd54910743e6a2261b67009624dbc7daeeafdef93616711b + md5: 369964e85dc26bfe78f41399b366c435 + depends: + - __osx >=11.0 + constrains: + - zlib 1.3.1 *_2 + license: Zlib + license_family: Other + size: 46438 + timestamp: 1727963202283 +- kind: conda + name: libzlib + version: 1.3.1 + build: hb9d3cd8_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + sha256: d4bfe88d7cb447768e31650f06257995601f89076080e76df55e3112d4e47dc4 + md5: edb0dca6bc32e4f4789199455a1dbeb8 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + constrains: + - zlib 1.3.1 *_2 + license: Zlib + license_family: Other + size: 60963 + timestamp: 1727963148474 +- kind: conda + name: llvm-openmp + version: 19.1.3 + build: hb52a8e5_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-19.1.3-hb52a8e5_0.conda + sha256: 49a8940e727aa82ee034fa9a60b3fcababec41b3192d955772aab635a5374b82 + md5: dd695d23e78d1ca4fecce969b1e1db61 + depends: + - __osx >=11.0 + constrains: + - openmp 19.1.3|19.1.3.* + license: Apache-2.0 WITH LLVM-exception + license_family: APACHE + size: 280488 + timestamp: 1730364082380 +- kind: conda + name: lz4-c + version: 1.9.4 + build: hb7217d7_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/lz4-c-1.9.4-hb7217d7_0.conda + sha256: fc343b8c82efe40819b986e29ba748366514e5ab94a1e1138df195af5f45fa24 + md5: 45505bec548634f7d05e02fb25262cb9 + depends: + - libcxx >=14.0.6 + license: BSD-2-Clause + license_family: BSD + size: 141188 + timestamp: 1674727268278 +- kind: conda + name: lz4-c + version: 1.10.0 + build: h5888daf_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/lz4-c-1.10.0-h5888daf_1.conda + sha256: 47326f811392a5fd3055f0f773036c392d26fdb32e4d8e7a8197eed951489346 + md5: 9de5350a85c4a20c685259b889aa6393 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + license: BSD-2-Clause + license_family: BSD + size: 167055 + timestamp: 1733741040117 +- kind: conda + name: markdown-it-py + version: 3.0.0 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-3.0.0-pyhd8ed1ab_1.conda + sha256: 0fbacdfb31e55964152b24d5567e9a9996e1e7902fb08eb7d91b5fd6ce60803a + md5: fee3164ac23dfca50cfcc8b85ddefb81 + depends: + - mdurl >=0.1,<1 + - python >=3.9 + license: MIT + license_family: MIT + size: 64430 + timestamp: 1733250550053 +- kind: conda + name: markupsafe + version: 3.0.2 + build: py312h178313f_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/markupsafe-3.0.2-py312h178313f_1.conda + sha256: 4a6bf68d2a2b669fecc9a4a009abd1cf8e72c2289522ff00d81b5a6e51ae78f5 + md5: eb227c3e0bf58f5bd69c0532b157975b + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - jinja2 >=3.0.0 + license: BSD-3-Clause + license_family: BSD + size: 24604 + timestamp: 1733219911494 +- kind: conda + name: markupsafe + version: 3.0.2 + build: py312h998013c_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/markupsafe-3.0.2-py312h998013c_1.conda + sha256: 4aa997b244014d3707eeef54ab0ee497d12c0d0d184018960cce096169758283 + md5: 46e547061080fddf9cf95a0327e8aba6 + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + constrains: + - jinja2 >=3.0.0 + license: BSD-3-Clause + license_family: BSD + size: 24048 + timestamp: 1733219945697 +- kind: conda + name: max + version: 24.6.0 + build: release + subdir: noarch + noarch: python + url: https://conda.modular.com/max/noarch/max-24.6.0-release.conda + sha256: 0e3c1984ac7476550fd8fa5921bf1ca58950219b84ae21ecd861f650e45382ac + md5: e04b1405f630c9bb7d4cb5559840e902 + depends: + - max-core ==24.6.0 release + - max-python >=24.6.0,<25.0a0 + - mojo-jupyter ==24.6.0 release + - mblack ==24.6.0 release + license: LicenseRef-Modular-Proprietary + size: 9851 + timestamp: 1734039439696 +- kind: conda + name: max-core + version: 24.6.0 + build: release + subdir: linux-64 + url: https://conda.modular.com/max/linux-64/max-core-24.6.0-release.conda + sha256: 38a4128c15b230f5b05e0606a339c7866a83eb943d334a948b3a8c1d2675a917 + md5: 25e678ff7c59e36ec3154fe0cd15ebde + depends: + - mblack ==24.6.0 release + arch: x86_64 + platform: linux + license: LicenseRef-Modular-Proprietary + size: 247670119 + timestamp: 1734039439695 +- kind: conda + name: max-core + version: 24.6.0 + build: release + subdir: osx-arm64 + url: https://conda.modular.com/max/osx-arm64/max-core-24.6.0-release.conda + sha256: 434c29e35067e296db55525cd5cf38bb013a1f7a7bfa99845bf6c317de6cdc12 + md5: 4a2ead0a9010c36b6193ea32f583e996 + depends: + - mblack ==24.6.0 release + arch: arm64 + platform: osx + license: LicenseRef-Modular-Proprietary + size: 212001240 + timestamp: 1734039726703 +- kind: conda + name: max-python + version: 24.6.0 + build: 3.12release + subdir: linux-64 + url: https://conda.modular.com/max/linux-64/max-python-24.6.0-3.12release.conda + sha256: 6fbf7330ad910e6ec9fd581fd0f8505e5b1326ccf9979d553c70c61abf4c3e54 + md5: 218ecd662f853ea1578404799d61b385 + depends: + - max-core ==24.6.0 release + - python 3.12.* + - fastapi + - httpx + - huggingface_hub + - numpy >=1.18,<2.0 + - opentelemetry-api + - opentelemetry-exporter-otlp-proto-http >=1.27.0 + - opentelemetry-exporter-prometheus >=0.48b0 + - opentelemetry-sdk >=1.27.0 + - pillow + - pydantic-settings >=2.4.0,<3 + - pydantic >=2.4.0,<3 + - pyinstrument + - python-json-logger + - sse-starlette >=2.1.3,<3 + - transformers + - typing_extensions + - uvicorn + - python_abi 3.12.* *_cp312 + arch: x86_64 + platform: linux + license: LicenseRef-Modular-Proprietary + size: 123785050 + timestamp: 1734039439704 +- kind: conda + name: max-python + version: 24.6.0 + build: 3.12release + subdir: osx-arm64 + url: https://conda.modular.com/max/osx-arm64/max-python-24.6.0-3.12release.conda + sha256: c888b58cfc7c767d40aa100ff2bccf5c3ab11d58d897a6accb749e6b5b7014ea + md5: 62a92bfab3b5c85c2d246672bbb8bc8d + depends: + - max-core ==24.6.0 release + - python 3.12.* + - fastapi + - httpx + - huggingface_hub + - numpy >=1.18,<2.0 + - opentelemetry-api + - opentelemetry-exporter-otlp-proto-http >=1.27.0 + - opentelemetry-exporter-prometheus >=0.48b0 + - opentelemetry-sdk >=1.27.0 + - pillow + - pydantic-settings >=2.4.0,<3 + - pydantic >=2.4.0,<3 + - pyinstrument + - python-json-logger + - sse-starlette >=2.1.3,<3 + - transformers + - typing_extensions + - uvicorn + - python_abi 3.12.* *_cp312 + arch: arm64 + platform: osx + license: LicenseRef-Modular-Proprietary + size: 112484803 + timestamp: 1734039726707 +- kind: conda + name: mblack + version: 24.6.0 + build: release + subdir: noarch + noarch: python + url: https://conda.modular.com/max/noarch/mblack-24.6.0-release.conda + sha256: f135164020478078f4681aa77e7f6ca9f68b8e7ee02604b85342bbaf2f706f0d + md5: 77367aff981ba391ab5c047ba33ec978 + depends: + - python >=3.9,<3.13 + - click >=8.0.0 + - mypy_extensions >=0.4.3 + - packaging >=22.0 + - pathspec >=0.9.0 + - platformdirs >=2 + - python + license: MIT + size: 130668 + timestamp: 1734039439700 +- kind: conda + name: mdurl + version: 0.1.2 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/mdurl-0.1.2-pyhd8ed1ab_1.conda + sha256: 78c1bbe1723449c52b7a9df1af2ee5f005209f67e40b6e1d3c7619127c43b1c7 + md5: 592132998493b3ff25fd7479396e8351 + depends: + - python >=3.9 + license: MIT + license_family: MIT + size: 14465 + timestamp: 1733255681319 +- kind: conda + name: mist + version: 0.1.10 + build: h60d57d3_0 + subdir: osx-arm64 + url: https://repo.prefix.dev/mojo-community/osx-arm64/mist-0.1.10-h60d57d3_0.conda + sha256: 5d3ea396a6ca3139874f3c9191071feac1f938f0a4d29b09d2fdbb4ca0f5fac9 + depends: + - max >=24.6.0 + arch: arm64 + platform: osx + license: MIT + size: 812382 + timestamp: 1734817876180 +- kind: conda + name: mist + version: 0.1.10 + build: hb0f4dca_0 + subdir: linux-64 + url: https://repo.prefix.dev/mojo-community/linux-64/mist-0.1.10-hb0f4dca_0.conda + sha256: 86e79e851318fef8a4b1b8dcb2eb299d931ba85037aabc4b37cfa9ce82eb64ab + depends: + - max >=24.6.0 + arch: x86_64 + platform: linux + license: MIT + size: 812397 + timestamp: 1734817872131 +- kind: conda + name: mog + version: 0.1.7 + build: h60d57d3_0 + subdir: osx-arm64 + url: https://repo.prefix.dev/mojo-community/osx-arm64/mog-0.1.7-h60d57d3_0.conda + sha256: 3046106ce7d539fbcb26bd8a31bc59cdaba4c6c870538ff9237ea97375cfeef5 + depends: + - max >=24.6.0 + - weave >=0.1.3 + - mist >=0.1.10 + arch: arm64 + platform: osx + license: MIT + size: 1136836 + timestamp: 1734884602984 +- kind: conda + name: mog + version: 0.1.7 + build: hb0f4dca_0 + subdir: linux-64 + url: https://repo.prefix.dev/mojo-community/linux-64/mog-0.1.7-hb0f4dca_0.conda + sha256: a275916cdf71f59730dbb9589a62ab62f9440f174a9403bace23fc6e95bd49d9 + depends: + - max >=24.6.0 + - weave >=0.1.3 + - mist >=0.1.10 + arch: x86_64 + platform: linux + license: MIT + size: 1136991 + timestamp: 1734884761066 +- kind: conda + name: mojo-jupyter + version: 24.6.0 + build: release + subdir: noarch + noarch: python + url: https://conda.modular.com/max/noarch/mojo-jupyter-24.6.0-release.conda + sha256: 2fe043d98ea77f8f165b39bd252cd04942216c8533f0291c49d87d6cfd8673df + md5: b17127f3ca2cef0976496407e1cd4081 + depends: + - max-core ==24.6.0 release + - python >=3.9,<3.13 + - jupyter_client >=8.6.2,<8.7 + - python + license: LicenseRef-Modular-Proprietary + size: 22990 + timestamp: 1734039439702 +- kind: conda + name: multidict + version: 6.1.0 + build: py312h178313f_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/multidict-6.1.0-py312h178313f_2.conda + sha256: b05bc8252a6e957bf4a776ed5e0e61d1ba88cdc46ccb55890c72cc58b10371f4 + md5: 5b5e3267d915a107eca793d52e1b780a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + size: 61507 + timestamp: 1733913288935 +- kind: conda + name: multidict + version: 6.1.0 + build: py312hdb8e49c_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/multidict-6.1.0-py312hdb8e49c_1.conda + sha256: 482fd09fb798090dc8cce2285fa69f43b1459099122eac2fb112d9b922b9f916 + md5: 0048335516fed938e4dd2c457b4c5b9b + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + size: 55968 + timestamp: 1729065664275 +- kind: conda + name: multiprocess + version: 0.70.15 + build: py312h02f2b3b_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/multiprocess-0.70.15-py312h02f2b3b_1.conda + sha256: 8041371e3ec3fbc2ca13c71b0180672896e6382e62892d9f6b11a4c5dd675951 + md5: 910ef2223c71902175418d9163152788 + depends: + - dill >=0.3.6 + - python >=3.12.0rc3,<3.13.0a0 + - python >=3.12.0rc3,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + size: 335147 + timestamp: 1695459275360 +- kind: conda + name: multiprocess + version: 0.70.15 + build: py312h98912ed_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/multiprocess-0.70.15-py312h98912ed_1.conda + sha256: bb612a921fafda6375a2204ffebd8811db8dd3b8f25ac9886cc9bcbff7e3664e + md5: 5a64b9f44790d9a187a85366dd0ffa8d + depends: + - dill >=0.3.6 + - libgcc-ng >=12 + - python >=3.12.0rc3,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + size: 335666 + timestamp: 1695459025249 +- kind: conda + name: mypy_extensions + version: 1.0.0 + build: pyha770c72_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/mypy_extensions-1.0.0-pyha770c72_0.conda + sha256: f240217476e148e825420c6bc3a0c0efb08c0718b7042fae960400c02af858a3 + md5: 4eccaeba205f0aed9ac3a9ea58568ca3 + depends: + - python >=3.5 + license: MIT + license_family: MIT + size: 10492 + timestamp: 1675543414256 +- kind: conda + name: ncurses + version: '6.5' + build: h7bae524_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.5-h7bae524_1.conda + sha256: 27d0b9ff78ad46e1f3a6c96c479ab44beda5f96def88e2fe626e0a49429d8afc + md5: cb2b0ea909b97b3d70cd3921d1445e1a + depends: + - __osx >=11.0 + license: X11 AND BSD-3-Clause + size: 802321 + timestamp: 1724658775723 +- kind: conda + name: ncurses + version: '6.5' + build: he02047a_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda + sha256: 6a1d5d8634c1a07913f1c525db6455918cbc589d745fac46d9d6e30340c8731a + md5: 70caf8bb6cf39a0b6b7efc885f51c0fe + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc-ng >=12 + license: X11 AND BSD-3-Clause + size: 889086 + timestamp: 1724658547447 +- kind: conda + name: numpy + version: 1.26.4 + build: py312h8442bc7_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/numpy-1.26.4-py312h8442bc7_0.conda + sha256: c8841d6d6f61fd70ca80682efbab6bdb8606dc77c68d8acabfbd7c222054f518 + md5: d83fc83d589e2625a3451c9a7e21047c + depends: + - libblas >=3.9.0,<4.0a0 + - libcblas >=3.9.0,<4.0a0 + - libcxx >=16 + - liblapack >=3.9.0,<4.0a0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 constrains: - - openblas >=0.3.28,<0.3.29.0a0 + - numpy-base <0a0 license: BSD-3-Clause license_family: BSD - size: 2934061 - timestamp: 1723931625423 + size: 6073136 + timestamp: 1707226249608 - kind: conda - name: libopenblas - version: 0.3.28 - build: pthreads_h94d23a6_0 + name: numpy + version: 1.26.4 + build: py312heda63a1_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.28-pthreads_h94d23a6_0.conda - sha256: 1e41a6d63e07be996238a1e840a426f86068956a45e0c0bb24e49a8dad9874c1 - md5: 9ebc9aedafaa2515ab247ff6bb509458 + url: https://conda.anaconda.org/conda-forge/linux-64/numpy-1.26.4-py312heda63a1_0.conda + sha256: fe3459c75cf84dcef6ef14efcc4adb0ade66038ddd27cadb894f34f4797687d8 + md5: d8285bea2a350f63fab23bf460221f3f depends: - - __glibc >=2.17,<3.0.a0 - - libgcc-ng >=14 - - libgfortran-ng - - libgfortran5 >=14.1.0 + - libblas >=3.9.0,<4.0a0 + - libcblas >=3.9.0,<4.0a0 + - libgcc-ng >=12 + - liblapack >=3.9.0,<4.0a0 + - libstdcxx-ng >=12 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 constrains: - - openblas >=0.3.28,<0.3.29.0a0 + - numpy-base <0a0 license: BSD-3-Clause license_family: BSD - size: 5572213 - timestamp: 1723932528810 + size: 7484186 + timestamp: 1707225809722 - kind: conda - name: libsodium - version: 1.0.20 - build: h4ab18f5_0 + name: openjpeg + version: 2.5.3 + build: h5fbd93e_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libsodium-1.0.20-h4ab18f5_0.conda - sha256: 0105bd108f19ea8e6a78d2d994a6d4a8db16d19a41212070d2d1d48a63c34161 - md5: a587892d3c13b6621a6091be690dbca2 + url: https://conda.anaconda.org/conda-forge/linux-64/openjpeg-2.5.3-h5fbd93e_0.conda + sha256: 5bee706ea5ba453ed7fd9da7da8380dd88b865c8d30b5aaec14d2b6dd32dbc39 + md5: 9e5816bc95d285c115a3ebc2f8563564 depends: - - libgcc-ng >=12 - license: ISC - size: 205978 - timestamp: 1716828628198 + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libpng >=1.6.44,<1.7.0a0 + - libstdcxx >=13 + - libtiff >=4.7.0,<4.8.0a0 + - libzlib >=1.3.1,<2.0a0 + license: BSD-2-Clause + license_family: BSD + size: 342988 + timestamp: 1733816638720 - kind: conda - name: libsodium - version: 1.0.20 - build: h99b78c6_0 + name: openjpeg + version: 2.5.3 + build: h8a3d83b_0 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libsodium-1.0.20-h99b78c6_0.conda - sha256: fade8223e1e1004367d7101dd17261003b60aa576df6d7802191f8972f7470b1 - md5: a7ce36e284c5faaf93c220dfc39e3abd + url: https://conda.anaconda.org/conda-forge/osx-arm64/openjpeg-2.5.3-h8a3d83b_0.conda + sha256: 1d59bc72ca7faac06d349c1a280f5cfb8a57ee5896f1e24225a997189d7418c7 + md5: 4b71d78648dbcf68ce8bf22bb07ff838 depends: - __osx >=11.0 - license: ISC - size: 164972 - timestamp: 1716828607917 + - libcxx >=18 + - libpng >=1.6.44,<1.7.0a0 + - libtiff >=4.7.0,<4.8.0a0 + - libzlib >=1.3.1,<2.0a0 + license: BSD-2-Clause + license_family: BSD + size: 319362 + timestamp: 1733816781741 - kind: conda - name: libsqlite - version: 3.47.0 - build: hadc24fc_1 - build_number: 1 + name: openssl + version: 3.3.2 + build: h8359307_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.3.2-h8359307_0.conda + sha256: 940fa01c4dc6152158fe8943e05e55a1544cab639df0994e3b35937839e4f4d1 + md5: 1773ebccdc13ec603356e8ff1db9e958 + depends: + - __osx >=11.0 + - ca-certificates + license: Apache-2.0 + license_family: Apache + size: 2882450 + timestamp: 1725410638874 +- kind: conda + name: openssl + version: 3.4.0 + build: hb9d3cd8_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.47.0-hadc24fc_1.conda - sha256: 8a9aadf996a2399f65b679c6e7f29139d5059f699c63e6d7b50e20db10c00508 - md5: b6f02b52a174e612e89548f4663ce56a + url: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.4.0-hb9d3cd8_0.conda + sha256: 814b9dff1847b132c676ee6cc1a8cb2d427320779b93e1b6d76552275c128705 + md5: 23cc74f77eb99315c0360ec3533147a9 depends: - __glibc >=2.17,<3.0.a0 + - ca-certificates - libgcc >=13 - - libzlib >=1.3.1,<2.0a0 - license: Unlicense - size: 875349 - timestamp: 1730208050020 + license: Apache-2.0 + license_family: Apache + size: 2947466 + timestamp: 1731377666602 - kind: conda - name: libsqlite - version: 3.47.0 - build: hbaaea75_1 + name: opentelemetry-api + version: 1.29.0 + build: pyhd8ed1ab_1 build_number: 1 - subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.47.0-hbaaea75_1.conda - sha256: 5a96caa566c11e5a5ebdcdb86a0759a7fb27d3c5f42e6a0fd0d6023c1e935d9e - md5: 07a14fbe439eef078cc479deca321161 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-api-1.29.0-pyhd8ed1ab_1.conda + sha256: 296280c8ace35c0a1cf72bed1077f248b3af903c3bf92332f1783a207cb5abdb + md5: 307b05402c1a382f2f09426492dee8f8 depends: - - __osx >=11.0 - - libzlib >=1.3.1,<2.0a0 - license: Unlicense - size: 837683 - timestamp: 1730208293578 + - deprecated >=1.2.6 + - importlib-metadata >=6.0,<=8.5.0 + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 44166 + timestamp: 1734132973331 - kind: conda - name: libstdcxx - version: 14.2.0 - build: hc0a3c3a_1 - build_number: 1 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-14.2.0-hc0a3c3a_1.conda - sha256: 4661af0eb9bdcbb5fb33e5d0023b001ad4be828fccdcc56500059d56f9869462 - md5: 234a5554c53625688d51062645337328 + name: opentelemetry-exporter-otlp-proto-common + version: 1.29.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-otlp-proto-common-1.29.0-pyhd8ed1ab_0.conda + sha256: ae9776efe52564e0d6711cfcee7c54439273e57a3999f7f796f66e862f58aae9 + md5: 0c02e74d26bce3fec93b227cf7ea6e6b depends: - - libgcc 14.2.0 h77fa898_1 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 3893695 - timestamp: 1729027746910 + - backoff >=1.10.0,<3.0.0 + - opentelemetry-proto 1.29.0 + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 18922 + timestamp: 1734310457116 - kind: conda - name: libstdcxx-ng - version: 14.2.0 - build: h4852527_1 + name: opentelemetry-exporter-otlp-proto-http + version: 1.29.0 + build: pyhd8ed1ab_1 build_number: 1 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.2.0-h4852527_1.conda - sha256: 25bb30b827d4f6d6f0522cc0579e431695503822f144043b93c50237017fffd8 - md5: 8371ac6457591af2cf6159439c1fd051 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-otlp-proto-http-1.29.0-pyhd8ed1ab_1.conda + sha256: 5d61db9d5b4f91b3932f5f2348920d5b7fdaa09e52c8ea054cf7bf3f21677c9c + md5: 223f4e56a29601c887f0dc467034af5b depends: - - libstdcxx 14.2.0 hc0a3c3a_1 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 54105 - timestamp: 1729027780628 + - deprecated >=1.2.6 + - googleapis-common-protos >=1.52,<2.dev0 + - opentelemetry-api >=1.15,<2.dev0 + - opentelemetry-exporter-otlp-proto-common 1.29.0 + - opentelemetry-proto 1.29.0 + - opentelemetry-sdk 1.29.0 + - python >=3.9 + - requests >=2.7,<3.dev0 + license: Apache-2.0 + license_family: APACHE + size: 17147 + timestamp: 1734345675510 - kind: conda - name: libuuid - version: 2.38.1 - build: h0b41bf4_0 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.38.1-h0b41bf4_0.conda - sha256: 787eb542f055a2b3de553614b25f09eefb0a0931b0c87dbcce6efdfd92f04f18 - md5: 40b61aab5c7ba9ff276c41cfffe6b80b + name: opentelemetry-exporter-prometheus + version: 1.12.0rc1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-exporter-prometheus-1.12.0rc1-pyhd8ed1ab_0.conda + sha256: b8239230dbbdb491401e41b53bd9f21d60551cedef1a8d5807fca1bf9bdd331c + md5: 1ddc95052b31147d1e10d818cf519cf5 depends: - - libgcc-ng >=12 - license: BSD-3-Clause - license_family: BSD - size: 33601 - timestamp: 1680112270483 + - opentelemetry-api >=1.10.0 + - opentelemetry-sdk >=1.10.0 + - prometheus_client >=0.5.0,<1.0.0 + - python >=3.6 + license: Apache-2.0 + license_family: APACHE + size: 14721 + timestamp: 1695214221489 - kind: conda - name: libxcrypt - version: 4.4.36 - build: hd590300_1 - build_number: 1 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda - sha256: 6ae68e0b86423ef188196fff6207ed0c8195dd84273cb5623b85aa08033a410c - md5: 5aa797f8787fe7a17d1b0821485b5adc + name: opentelemetry-proto + version: 1.29.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-proto-1.29.0-pyhd8ed1ab_0.conda + sha256: 200a7cb8acc8a0ddd6ef55c5460cec871b6a265929b240a0296c0ccb9c8d9758 + md5: e2a6d2ad10b813c7fdc1c64aac376128 depends: - - libgcc-ng >=12 - license: LGPL-2.1-or-later - size: 100393 - timestamp: 1702724383534 + - protobuf <6.0,>=5.0 + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 37235 + timestamp: 1734291034372 - kind: conda - name: libzlib - version: 1.3.1 - build: h8359307_2 + name: opentelemetry-sdk + version: 1.29.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-sdk-1.29.0-pyhd8ed1ab_0.conda + sha256: 7b36629d8b8be8a019fcfd1518d7b7f862dd25de96f8adcadb93e4fd12cf9bd6 + md5: 2a8893f06e6ebda4bfa78875bc923ea4 + depends: + - opentelemetry-api 1.29.0 + - opentelemetry-semantic-conventions 0.50b0 + - python >=3.9 + - typing-extensions >=3.7.4 + - typing_extensions >=3.7.4 + license: Apache-2.0 + license_family: APACHE + size: 77645 + timestamp: 1734297838999 +- kind: conda + name: opentelemetry-semantic-conventions + version: 0.50b0 + build: pyh3cfb1c2_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/opentelemetry-semantic-conventions-0.50b0-pyh3cfb1c2_0.conda + sha256: 6526e70368d5bf66ef0eaa51fb800d53782dde71a24bd38f40139919a6f784dc + md5: f7111fa4188d646c8108e232d024cb99 + depends: + - deprecated >=1.2.6 + - opentelemetry-api 1.29.0 + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 86084 + timestamp: 1734208980168 +- kind: conda + name: orc + version: 2.0.2 + build: hcb3c8b3_2 build_number: 2 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.3.1-h8359307_2.conda - sha256: ce34669eadaba351cd54910743e6a2261b67009624dbc7daeeafdef93616711b - md5: 369964e85dc26bfe78f41399b366c435 + url: https://conda.anaconda.org/conda-forge/osx-arm64/orc-2.0.2-hcb3c8b3_2.conda + sha256: 70d5045cbccfb472578b5b9e9e200b7dd122486e5e9a93e9424967f53d838352 + md5: 3d2c62c12889872216f673c452d23186 depends: - __osx >=11.0 - constrains: - - zlib 1.3.1 *_2 - license: Zlib - license_family: Other - size: 46438 - timestamp: 1727963202283 + - libcxx >=17 + - libprotobuf >=5.28.2,<5.28.3.0a0 + - libzlib >=1.3.1,<2.0a0 + - lz4-c >=1.9.3,<1.10.0a0 + - snappy >=1.2.1,<1.3.0a0 + - tzdata + - zstd >=1.5.6,<1.6.0a0 + license: Apache-2.0 + license_family: Apache + size: 445202 + timestamp: 1729549236424 - kind: conda - name: libzlib - version: 1.3.1 - build: hb9d3cd8_2 - build_number: 2 + name: orc + version: 2.0.3 + build: h97ab989_1 + build_number: 1 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda - sha256: d4bfe88d7cb447768e31650f06257995601f89076080e76df55e3112d4e47dc4 - md5: edb0dca6bc32e4f4789199455a1dbeb8 + url: https://conda.anaconda.org/conda-forge/linux-64/orc-2.0.3-h97ab989_1.conda + sha256: 9de7e2746fde57c9b7f08ee87142014f6bb9b2d3a506839ea3e98baa99711576 + md5: 2f46eae652623114e112df13fae311cf depends: - __glibc >=2.17,<3.0.a0 - libgcc >=13 - constrains: - - zlib 1.3.1 *_2 - license: Zlib - license_family: Other - size: 60963 - timestamp: 1727963148474 -- kind: conda - name: llvm-openmp - version: 19.1.3 - build: hb52a8e5_0 - subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-19.1.3-hb52a8e5_0.conda - sha256: 49a8940e727aa82ee034fa9a60b3fcababec41b3192d955772aab635a5374b82 - md5: dd695d23e78d1ca4fecce969b1e1db61 - depends: - - __osx >=11.0 - constrains: - - openmp 19.1.3|19.1.3.* - license: Apache-2.0 WITH LLVM-exception - license_family: APACHE - size: 280488 - timestamp: 1730364082380 + - libprotobuf >=5.28.2,<5.28.3.0a0 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 + - lz4-c >=1.10.0,<1.11.0a0 + - snappy >=1.2.1,<1.3.0a0 + - tzdata + - zstd >=1.5.6,<1.6.0a0 + license: Apache-2.0 + license_family: Apache + size: 1189462 + timestamp: 1733509801323 - kind: conda - name: max - version: 24.5.0 - build: release + name: packaging + version: '24.1' + build: pyhd8ed1ab_0 subdir: noarch noarch: python - url: https://conda.modular.com/max/noarch/max-24.5.0-release.conda - sha256: 3050d7885a304944afbf93ca9786e56e6df20f0685e1705f88fab045fb5aae70 - md5: 662a61803cd141e857d3b9f821c7bd66 + url: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda + sha256: 36aca948219e2c9fdd6d80728bcc657519e02f06c2703d8db3446aec67f51d81 + md5: cbe1bb1f21567018ce595d9c2be0f0db depends: - - max-core ==24.5.0 release - - max-python >=24.5.0,<25.0a0 - - mojo-jupyter ==24.5.0 release - - mblack ==24.5.0 release - size: 9642 - timestamp: 1726172475909 + - python >=3.8 + license: Apache-2.0 + license_family: APACHE + size: 50290 + timestamp: 1718189540074 - kind: conda - name: max-core - version: 24.5.0 - build: release + name: pandas + version: 2.2.3 + build: py312hcd31e36_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/pandas-2.2.3-py312hcd31e36_1.conda + sha256: ff0cb54b5d058c7987b4a0984066e893642d1865a7bb695294b6172e2fcdc457 + md5: c68bfa69e6086c381c74e16fd72613a8 + depends: + - __osx >=11.0 + - libcxx >=17 + - numpy >=1.19,<3 + - numpy >=1.22.4 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python-dateutil >=2.8.1 + - python-tzdata >=2022a + - python_abi 3.12.* *_cp312 + - pytz >=2020.1,<2024.2 + license: BSD-3-Clause + license_family: BSD + size: 14470437 + timestamp: 1726878887799 +- kind: conda + name: pandas + version: 2.2.3 + build: py312hf9745cd_1 + build_number: 1 subdir: linux-64 - url: https://conda.modular.com/max/linux-64/max-core-24.5.0-release.conda - sha256: 4cd4ab217863a500e9df8112d5e4c335192baa4f527aaaacb925b7818dd2bbe1 - md5: a9b3f9d69310032f687789c475c029f5 + url: https://conda.anaconda.org/conda-forge/linux-64/pandas-2.2.3-py312hf9745cd_1.conda + sha256: ad275a83bfebfa8a8fee9b0569aaf6f513ada6a246b2f5d5b85903d8ca61887e + md5: 8bce4f6caaf8c5448c7ac86d87e26b4b depends: - - mblack ==24.5.0 release - arch: x86_64 - platform: linux - size: 284994357 - timestamp: 1726172475907 + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + - numpy >=1.19,<3 + - numpy >=1.22.4 + - python >=3.12,<3.13.0a0 + - python-dateutil >=2.8.1 + - python-tzdata >=2022a + - python_abi 3.12.* *_cp312 + - pytz >=2020.1,<2024.2 + license: BSD-3-Clause + license_family: BSD + size: 15436913 + timestamp: 1726879054912 - kind: conda - name: max-core - version: 24.5.0 - build: release - subdir: osx-arm64 - url: https://conda.modular.com/max/osx-arm64/max-core-24.5.0-release.conda - sha256: 8848071dde1f98a4da8e39c90f9210098e7c3c4aaddd0e2255fd9fe1f01df0b7 - md5: fba502bf5142da57735a593ccf35a255 + name: pathspec + version: 0.12.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pathspec-0.12.1-pyhd8ed1ab_0.conda + sha256: 4e534e66bfe8b1e035d2169d0e5b185450546b17e36764272863e22e0370be4d + md5: 17064acba08d3686f1135b5ec1b32b12 depends: - - mblack ==24.5.0 release - arch: arm64 - platform: osx - size: 244231803 - timestamp: 1726175523753 + - python >=3.7 + license: MPL-2.0 + license_family: MOZILLA + size: 41173 + timestamp: 1702250135032 - kind: conda - name: max-python - version: 24.5.0 - build: 3.12release + name: pillow + version: 11.0.0 + build: py312h7b63e92_0 subdir: linux-64 - url: https://conda.modular.com/max/linux-64/max-python-24.5.0-3.12release.conda - sha256: b5b0f36bb4c91bdff229fc680d7d2e4dd183e9dc90808869408e5883d95199ba - md5: e8dbea1cf138f97c022103a4b41c77bd + url: https://conda.anaconda.org/conda-forge/linux-64/pillow-11.0.0-py312h7b63e92_0.conda + sha256: 13a464bea02c0df0199c20ef6bad24a6bc336aaf55bf8d6a133d0fe664463224 + md5: 385f46a4df6f97892503a841121a9acf depends: - - max-core ==24.5.0 release - - python 3.12.* - - numpy >=1.18,<2.0 + - __glibc >=2.17,<3.0.a0 + - freetype >=2.12.1,<3.0a0 + - lcms2 >=2.16,<3.0a0 + - libgcc >=13 + - libjpeg-turbo >=3.0.0,<4.0a0 + - libtiff >=4.7.0,<4.8.0a0 + - libwebp-base >=1.4.0,<2.0a0 + - libxcb >=1.17.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - openjpeg >=2.5.2,<3.0a0 + - python >=3.12,<3.13.0a0 - python_abi 3.12.* *_cp312 - arch: x86_64 - platform: linux - size: 138310039 - timestamp: 1726172475912 + - tk >=8.6.13,<8.7.0a0 + license: HPND + size: 41948418 + timestamp: 1729065846594 - kind: conda - name: max-python - version: 24.5.0 - build: 3.12release + name: pillow + version: 11.0.0 + build: py312haf37ca6_0 subdir: osx-arm64 - url: https://conda.modular.com/max/osx-arm64/max-python-24.5.0-3.12release.conda - sha256: e6cdd0477236d49d4f6586d4a66ffe1c5e5cb188535a8ec09ed742eda12cbf5f - md5: f33d8f4cc5c17d893fdb5d6e162c08c6 + url: https://conda.anaconda.org/conda-forge/osx-arm64/pillow-11.0.0-py312haf37ca6_0.conda + sha256: 727b4c3faecdb6f6809cf20c5f32d2df4af34e0d5b9146b7588383bcba7990e8 + md5: dc9b51fbd2b6f7fea9b5123458864dbb depends: - - max-core ==24.5.0 release - - python 3.12.* - - numpy >=1.18,<2.0 + - __osx >=11.0 + - freetype >=2.12.1,<3.0a0 + - lcms2 >=2.16,<3.0a0 + - libjpeg-turbo >=3.0.0,<4.0a0 + - libtiff >=4.7.0,<4.8.0a0 + - libwebp-base >=1.4.0,<2.0a0 + - libxcb >=1.17.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - openjpeg >=2.5.2,<3.0a0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython - python_abi 3.12.* *_cp312 - arch: arm64 - platform: osx - size: 125388933 - timestamp: 1726175523755 + - tk >=8.6.13,<8.7.0a0 + license: HPND + size: 41737424 + timestamp: 1729065920347 - kind: conda - name: mblack - version: 24.5.0 - build: release + name: platformdirs + version: 4.3.6 + build: pyhd8ed1ab_0 subdir: noarch noarch: python - url: https://conda.modular.com/max/noarch/mblack-24.5.0-release.conda - sha256: 913881fc3aa19db447ed82e898f261a413be9129dc43b9ea600e06030f76dbd5 - md5: 2bc6ce9f257235686dc1b2509cc7198d + url: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.3.6-pyhd8ed1ab_0.conda + sha256: c81bdeadc4adcda216b2c7b373f0335f5c78cc480d1d55d10f21823590d7e46f + md5: fd8f2b18b65bbf62e8f653100690c8d2 depends: - - python >=3.9,<3.13 - - click >=8.0.0 - - mypy_extensions >=0.4.3 - - packaging >=22.0 - - pathspec >=0.9.0 - - platformdirs >=2 - - python + - python >=3.8 license: MIT - size: 130435 - timestamp: 1726172475910 + license_family: MIT + size: 20625 + timestamp: 1726613611845 - kind: conda - name: mist - version: 0.1.8 - build: h60d57d3_0 - subdir: osx-arm64 - url: https://repo.prefix.dev/mojo-community/osx-arm64/mist-0.1.8-h60d57d3_0.conda - sha256: ab356b35811068c23562b2eb57d5e874906ca27b579c69924b6b3ea20e704133 + name: prometheus_client + version: 0.21.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/prometheus_client-0.21.1-pyhd8ed1ab_0.conda + sha256: bc8f00d5155deb7b47702cb8370f233935704100dbc23e30747c161d1b6cf3ab + md5: 3e01e386307acc60b2f89af0b2e161aa depends: - - gojo >=0.1.12,<0.2 - - hue >=0.1.6,<0.2 - - max >=24.5.0,<25 - arch: arm64 - platform: osx - license: MIT - size: 478417 - timestamp: 1727015774057 + - python >=3.9 + license: Apache-2.0 + license_family: Apache + size: 49002 + timestamp: 1733327434163 - kind: conda - name: mist - version: 0.1.8 - build: hb0f4dca_0 + name: propcache + version: 0.2.1 + build: py312h66e93f0_0 subdir: linux-64 - url: https://repo.prefix.dev/mojo-community/linux-64/mist-0.1.8-hb0f4dca_0.conda - sha256: 9b2a1d26ae55a1d29af8f60c21dd827dc8f7f13d9ddea0acd553b8afe10545b6 + url: https://conda.anaconda.org/conda-forge/linux-64/propcache-0.2.1-py312h66e93f0_0.conda + sha256: 5771311fb5ded614ca349c92579a0b752af55a310f40b71fc533e20625965391 + md5: 55d5742a696d7da1c1262e99b6217ceb depends: - - gojo >=0.1.12,<0.2 - - hue >=0.1.6,<0.2 - - max >=24.5.0,<25 - arch: x86_64 - platform: linux - license: MIT - size: 478603 - timestamp: 1727015771250 + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + size: 52747 + timestamp: 1733391916349 - kind: conda - name: mog - version: 0.1.6 - build: h60d57d3_0 + name: propcache + version: 0.2.1 + build: py312hea69d52_0 subdir: osx-arm64 - url: https://repo.prefix.dev/mojo-community/osx-arm64/mog-0.1.6-h60d57d3_0.conda - sha256: af42eb9c2b8bb709a32b00ddf0b310908e9f8ca2b484505559c3850acc2866ac + url: https://conda.anaconda.org/conda-forge/osx-arm64/propcache-0.2.1-py312hea69d52_0.conda + sha256: f8c266c494aa1e4cfb8bf0b6fca060044b2f3d65afe4c5062ebeea382e77aa6d + md5: c84e3dd97fe25a17322c4a0f670c6750 depends: - - gojo >=0.1.9,<0.2 - - max >=24.5.0,<25 - - weave >=0.1.1,<0.2 - - mist >=0.1.5,<0.2 - arch: arm64 - platform: osx - license: MIT - size: 920181 - timestamp: 1726686903590 + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + size: 48225 + timestamp: 1733392308901 - kind: conda - name: mog - version: 0.1.6 - build: hb0f4dca_0 + name: protobuf + version: 5.28.2 + build: py312h2ec8cdc_0 subdir: linux-64 - url: https://repo.prefix.dev/mojo-community/linux-64/mog-0.1.6-hb0f4dca_0.conda - sha256: 3b11cee959dfa869112de03da606cbdfcbd4ed265746c74c6ed089216aa20d7d + url: https://conda.anaconda.org/conda-forge/linux-64/protobuf-5.28.2-py312h2ec8cdc_0.conda + sha256: 4884f8161602f0148ebbc1af8d3176cec80b96c83243f68aafd651986b573817 + md5: 586bead4a9dfa46faf88deb7d3a742bb depends: - - gojo >=0.1.9,<0.2 - - max >=24.5.0,<25 - - weave >=0.1.1,<0.2 - - mist >=0.1.5,<0.2 - arch: x86_64 - platform: linux - license: MIT - size: 920604 - timestamp: 1726686906280 + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - libprotobuf 5.28.2 + license: BSD-3-Clause + license_family: BSD + size: 464548 + timestamp: 1728669645013 - kind: conda - name: mojo-jupyter - version: 24.5.0 - build: release - subdir: noarch - noarch: python - url: https://conda.modular.com/max/noarch/mojo-jupyter-24.5.0-release.conda - sha256: dff2e857eae32ce92fde12a712756d647f0aa312aeb5d79b350b2acbc71a2f96 - md5: 3b7be5cbff5b8015b095e950506be4b3 + name: protobuf + version: 5.28.2 + build: py312hf02c72a_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/protobuf-5.28.2-py312hf02c72a_0.conda + sha256: dbcec117510ced5c12097e3eb06ebbf4512dc255733a9ace33c4249fb7e6a364 + md5: 6fda46c82abd0a080ca33de7d16ca877 depends: - - max-core ==24.5.0 release - - python >=3.9,<3.13 - - jupyter_client >=8.6.2,<8.7 - - python - size: 21595 - timestamp: 1726172475911 + - __osx >=11.0 + - libcxx >=17 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + constrains: + - libprotobuf 5.28.2 + license: BSD-3-Clause + license_family: BSD + size: 447369 + timestamp: 1728669902591 - kind: conda - name: mypy_extensions - version: 1.0.0 - build: pyha770c72_0 - subdir: noarch - noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/mypy_extensions-1.0.0-pyha770c72_0.conda - sha256: f240217476e148e825420c6bc3a0c0efb08c0718b7042fae960400c02af858a3 - md5: 4eccaeba205f0aed9ac3a9ea58568ca3 + name: pthread-stubs + version: '0.4' + build: hb9d3cd8_1002 + build_number: 1002 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-hb9d3cd8_1002.conda + sha256: 9c88f8c64590e9567c6c80823f0328e58d3b1efb0e1c539c0315ceca764e0973 + md5: b3c17d95b5a10c6e64a21fa17573e70e depends: - - python >=3.5 + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 license: MIT license_family: MIT - size: 10492 - timestamp: 1675543414256 + size: 8252 + timestamp: 1726802366959 - kind: conda - name: ncurses - version: '6.5' - build: h7bae524_1 - build_number: 1 + name: pthread-stubs + version: '0.4' + build: hd74edd7_1002 + build_number: 1002 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.5-h7bae524_1.conda - sha256: 27d0b9ff78ad46e1f3a6c96c479ab44beda5f96def88e2fe626e0a49429d8afc - md5: cb2b0ea909b97b3d70cd3921d1445e1a + url: https://conda.anaconda.org/conda-forge/osx-arm64/pthread-stubs-0.4-hd74edd7_1002.conda + sha256: 8ed65e17fbb0ca944bfb8093b60086e3f9dd678c3448b5de212017394c247ee3 + md5: 415816daf82e0b23a736a069a75e9da7 depends: - __osx >=11.0 - license: X11 AND BSD-3-Clause - size: 802321 - timestamp: 1724658775723 + license: MIT + license_family: MIT + size: 8381 + timestamp: 1726802424786 - kind: conda - name: ncurses - version: '6.5' - build: he02047a_1 - build_number: 1 + name: pyarrow + version: 18.0.0 + build: py312h1f38498_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/pyarrow-18.0.0-py312h1f38498_2.conda + sha256: 11c045b44019dbe908315aabb47491519c0a4b5ef07e97a056a9d57d07823de3 + md5: 71ea0ef18b1127e26efaedc875e1853a + depends: + - libarrow-acero 18.0.0.* + - libarrow-dataset 18.0.0.* + - libarrow-substrait 18.0.0.* + - libparquet 18.0.0.* + - pyarrow-core 18.0.0 *_2_* + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + size: 25410 + timestamp: 1732456749184 +- kind: conda + name: pyarrow + version: 18.1.0 + build: py312h7900ff3_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda - sha256: 6a1d5d8634c1a07913f1c525db6455918cbc589d745fac46d9d6e30340c8731a - md5: 70caf8bb6cf39a0b6b7efc885f51c0fe + url: https://conda.anaconda.org/conda-forge/linux-64/pyarrow-18.1.0-py312h7900ff3_0.conda + sha256: 46a61c29375d3bf1933eae61c7861394c168898915d59fc99bf05e46de2ff5ad + md5: ac65b70df28687c6af4270923c020bdd depends: - - __glibc >=2.17,<3.0.a0 - - libgcc-ng >=12 - license: X11 AND BSD-3-Clause - size: 889086 - timestamp: 1724658547447 + - libarrow-acero 18.1.0.* + - libarrow-dataset 18.1.0.* + - libarrow-substrait 18.1.0.* + - libparquet 18.1.0.* + - pyarrow-core 18.1.0 *_0_* + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + size: 25213 + timestamp: 1732610785600 - kind: conda - name: numpy - version: 1.26.4 - build: py312h8442bc7_0 + name: pyarrow-core + version: 18.0.0 + build: py312hc40f475_2_cpu + build_number: 2 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/numpy-1.26.4-py312h8442bc7_0.conda - sha256: c8841d6d6f61fd70ca80682efbab6bdb8606dc77c68d8acabfbd7c222054f518 - md5: d83fc83d589e2625a3451c9a7e21047c + url: https://conda.anaconda.org/conda-forge/osx-arm64/pyarrow-core-18.0.0-py312hc40f475_2_cpu.conda + sha256: 83633ec13d303fee24c6f45a8fca0fedad4a80e7ea552a4f06b5643a26ba99f1 + md5: 35308386ec8499ac7114af0edd8de3a2 depends: - - libblas >=3.9.0,<4.0a0 - - libcblas >=3.9.0,<4.0a0 - - libcxx >=16 - - liblapack >=3.9.0,<4.0a0 + - __osx >=11.0 + - libarrow 18.0.0.* *cpu + - libcxx >=18 + - libzlib >=1.3.1,<2.0a0 - python >=3.12,<3.13.0a0 - python >=3.12,<3.13.0a0 *_cpython - python_abi 3.12.* *_cp312 constrains: - - numpy-base <0a0 - license: BSD-3-Clause - license_family: BSD - size: 6073136 - timestamp: 1707226249608 + - numpy >=1.21,<3 + - apache-arrow-proc =*=cpu + license: Apache-2.0 + license_family: APACHE + size: 3918835 + timestamp: 1732456722657 - kind: conda - name: numpy - version: 1.26.4 - build: py312heda63a1_0 + name: pyarrow-core + version: 18.1.0 + build: py312h01725c0_0_cpu subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/numpy-1.26.4-py312heda63a1_0.conda - sha256: fe3459c75cf84dcef6ef14efcc4adb0ade66038ddd27cadb894f34f4797687d8 - md5: d8285bea2a350f63fab23bf460221f3f + url: https://conda.anaconda.org/conda-forge/linux-64/pyarrow-core-18.1.0-py312h01725c0_0_cpu.conda + sha256: 948a4161c56f846d374a3721a657e58ddbc992a29b3b3e7a6411975c30361d94 + md5: ee80934a6c280ff8635f8db5dec11e04 depends: - - libblas >=3.9.0,<4.0a0 - - libcblas >=3.9.0,<4.0a0 - - libgcc-ng >=12 - - liblapack >=3.9.0,<4.0a0 - - libstdcxx-ng >=12 + - __glibc >=2.17,<3.0.a0 + - libarrow 18.1.0.* *cpu + - libgcc >=13 + - libstdcxx >=13 + - libzlib >=1.3.1,<2.0a0 - python >=3.12,<3.13.0a0 - python_abi 3.12.* *_cp312 constrains: - - numpy-base <0a0 + - numpy >=1.21,<3 + - apache-arrow-proc =*=cpu + license: Apache-2.0 + license_family: APACHE + size: 4612916 + timestamp: 1732610377259 +- kind: conda + name: pycparser + version: '2.22' + build: pyh29332c3_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + sha256: 79db7928d13fab2d892592223d7570f5061c192f27b9febd1a418427b719acc6 + md5: 12c566707c80111f9799308d9e265aef + depends: + - python >=3.9 + - python license: BSD-3-Clause license_family: BSD - size: 7484186 - timestamp: 1707225809722 -- kind: conda - name: openssl - version: 3.3.2 - build: h8359307_0 - subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.3.2-h8359307_0.conda - sha256: 940fa01c4dc6152158fe8943e05e55a1544cab639df0994e3b35937839e4f4d1 - md5: 1773ebccdc13ec603356e8ff1db9e958 + size: 110100 + timestamp: 1733195786147 +- kind: conda + name: pydantic + version: 2.10.4 + build: pyh3cfb1c2_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pydantic-2.10.4-pyh3cfb1c2_0.conda + sha256: e68400714532a33f34b44ddaee3e27e8dd6c83c3f31c7892ec10b84d13aa8b59 + md5: 93bccf4d7a58c9140d59491de21e044b depends: - - __osx >=11.0 - - ca-certificates - license: Apache-2.0 - license_family: Apache - size: 2882450 - timestamp: 1725410638874 + - annotated-types >=0.6.0 + - pydantic-core 2.27.2 + - python >=3.9 + - typing-extensions >=4.6.1 + - typing_extensions >=4.12.2 + license: MIT + license_family: MIT + size: 296557 + timestamp: 1734609427697 - kind: conda - name: openssl - version: 3.3.2 - build: hb9d3cd8_0 + name: pydantic-core + version: 2.27.2 + build: py312h12e396e_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.3.2-hb9d3cd8_0.conda - sha256: cee91036686419f6dd6086902acf7142b4916e1c4ba042e9ca23e151da012b6d - md5: 4d638782050ab6faa27275bed57e9b4e + url: https://conda.anaconda.org/conda-forge/linux-64/pydantic-core-2.27.2-py312h12e396e_0.conda + sha256: 81602a4592ad2ac1a1cb57372fd25214e63b1c477d5818b0c21cde0f1f85c001 + md5: bae01b2563030c085f5158c518b84e86 depends: - __glibc >=2.17,<3.0.a0 - - ca-certificates - libgcc >=13 - license: Apache-2.0 - license_family: Apache - size: 2891789 - timestamp: 1725410790053 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - typing-extensions >=4.6.0,!=4.7.0 + constrains: + - __glibc >=2.17 + license: MIT + license_family: MIT + size: 1641402 + timestamp: 1734571789895 - kind: conda - name: packaging - version: '24.1' - build: pyhd8ed1ab_0 + name: pydantic-core + version: 2.27.2 + build: py312hcd83bfe_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/pydantic-core-2.27.2-py312hcd83bfe_0.conda + sha256: cfa7201f890d5d08ce29ff70e65a96787d5793a1718776733666b44bbd4a1205 + md5: dcb307e02f17d38c6e1cbfbf8c602852 + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + - typing-extensions >=4.6.0,!=4.7.0 + constrains: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 1593461 + timestamp: 1734571986644 +- kind: conda + name: pydantic-settings + version: 2.7.0 + build: pyh3cfb1c2_0 subdir: noarch noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/packaging-24.1-pyhd8ed1ab_0.conda - sha256: 36aca948219e2c9fdd6d80728bcc657519e02f06c2703d8db3446aec67f51d81 - md5: cbe1bb1f21567018ce595d9c2be0f0db + url: https://conda.anaconda.org/conda-forge/noarch/pydantic-settings-2.7.0-pyh3cfb1c2_0.conda + sha256: dd1ac7c8b6a189c8aa18f6c7df019d8f6df495300a259e3fbebdb542fc955c3b + md5: d9f19a7c4199249fa229891b573b6f9b depends: - - python >=3.8 - license: Apache-2.0 - license_family: APACHE - size: 50290 - timestamp: 1718189540074 + - pydantic >=2.7.0 + - python >=3.9 + - python-dotenv >=0.21.0 + license: MIT + license_family: MIT + size: 31426 + timestamp: 1734127929720 - kind: conda - name: pathspec - version: 0.12.1 - build: pyhd8ed1ab_0 + name: pygments + version: 2.18.0 + build: pyhd8ed1ab_1 + build_number: 1 subdir: noarch noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/pathspec-0.12.1-pyhd8ed1ab_0.conda - sha256: 4e534e66bfe8b1e035d2169d0e5b185450546b17e36764272863e22e0370be4d - md5: 17064acba08d3686f1135b5ec1b32b12 + url: https://conda.anaconda.org/conda-forge/noarch/pygments-2.18.0-pyhd8ed1ab_1.conda + sha256: 0d6133545f268b2b89c2617c196fc791f365b538d4057ecd636d658c3b1e885d + md5: b38dc0206e2a530e5c2cf11dc086b31a depends: - - python >=3.7 - license: MPL-2.0 - license_family: MOZILLA - size: 41173 - timestamp: 1702250135032 + - python >=3.9 + license: BSD-2-Clause + license_family: BSD + size: 876700 + timestamp: 1733221731178 - kind: conda - name: platformdirs - version: 4.3.6 - build: pyhd8ed1ab_0 + name: pyinstrument + version: 5.0.0 + build: py312h0bf5046_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/pyinstrument-5.0.0-py312h0bf5046_0.conda + sha256: 6879d52fb0ec2258e2850476786a652c394220d53883c53691ed5390183ae925 + md5: f0e4a98d54477083ddc9d2f33507f848 + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + size: 181512 + timestamp: 1728714205508 +- kind: conda + name: pyinstrument + version: 5.0.0 + build: py312h66e93f0_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/pyinstrument-5.0.0-py312h66e93f0_0.conda + sha256: 8a006507a4003fb01eeee2f9ba79f994478694766ea3b445273da5c11cf8e763 + md5: 798f42d9bfdf125dc80ffbec0e96e0b6 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + size: 182021 + timestamp: 1728714164706 +- kind: conda + name: pysocks + version: 1.7.1 + build: pyha55dd90_7 + build_number: 7 subdir: noarch noarch: python - url: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.3.6-pyhd8ed1ab_0.conda - sha256: c81bdeadc4adcda216b2c7b373f0335f5c78cc480d1d55d10f21823590d7e46f - md5: fd8f2b18b65bbf62e8f653100690c8d2 + url: https://conda.anaconda.org/conda-forge/noarch/pysocks-1.7.1-pyha55dd90_7.conda + sha256: ba3b032fa52709ce0d9fd388f63d330a026754587a2f461117cac9ab73d8d0d8 + md5: 461219d1a5bd61342293efa2c0c90eac depends: - - python >=3.8 - license: MIT - license_family: MIT - size: 20625 - timestamp: 1726613611845 + - __unix + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + size: 21085 + timestamp: 1733217331982 - kind: conda name: python version: 3.12.7 @@ -1388,6 +5259,106 @@ packages: license_family: APACHE size: 222742 timestamp: 1709299922152 +- kind: conda + name: python-dotenv + version: 1.0.1 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/python-dotenv-1.0.1-pyhd8ed1ab_1.conda + sha256: 99713f6b534fef94995c6c16fd21d59f3548784e9111775d692bdc7c44678f02 + md5: e5c6ed218664802d305e79cc2d4491de + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + size: 24215 + timestamp: 1733243277223 +- kind: conda + name: python-json-logger + version: 2.0.7 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/python-json-logger-2.0.7-pyhd8ed1ab_0.conda + sha256: 4790787fe1f4e8da616edca4acf6a4f8ed4e7c6967aa31b920208fc8f95efcca + md5: a61bf9ec79426938ff785eb69dbb1960 + depends: + - python >=3.6 + license: BSD-2-Clause + license_family: BSD + size: 13383 + timestamp: 1677079727691 +- kind: conda + name: python-multipart + version: 0.0.20 + build: pyhff2d567_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/python-multipart-0.0.20-pyhff2d567_0.conda + sha256: 1b03678d145b1675b757cba165a0d9803885807792f7eb4495e48a38858c3cca + md5: a28c984e0429aff3ab7386f7de56de6f + depends: + - python >=3.9 + license: Apache-2.0 + license_family: Apache + size: 27913 + timestamp: 1734420869885 +- kind: conda + name: python-tzdata + version: '2024.2' + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/python-tzdata-2024.2-pyhd8ed1ab_1.conda + sha256: 57c9a02ec25926fb48edca59b9ede107823e5d5c473b94a0e05cc0b9a193a642 + md5: c0def296b2f6d2dd7b030c2a7f66bb1f + depends: + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 142235 + timestamp: 1733235414217 +- kind: conda + name: python-xxhash + version: 3.5.0 + build: py312h024a12e_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/python-xxhash-3.5.0-py312h024a12e_1.conda + sha256: 28204ef48f028a4d872e22040da0dad7ebd703549b010a1bb511b6dd94cf466d + md5: 266fe1ae54a7bb17990206664d0f0ae4 + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + - xxhash >=0.8.2,<0.8.3.0a0 + license: BSD-2-Clause + license_family: BSD + size: 21765 + timestamp: 1725272382968 +- kind: conda + name: python-xxhash + version: 3.5.0 + build: py312h66e93f0_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/python-xxhash-3.5.0-py312h66e93f0_1.conda + sha256: 20851b1e59fee127d49e01fc73195a88ab0779f103b7d6ffc90d11142a83678f + md5: 39aed2afe4d0cf76ab3d6b09eecdbea7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - xxhash >=0.8.2,<0.8.3.0a0 + license: BSD-2-Clause + license_family: BSD + size: 23162 + timestamp: 1725272139519 - kind: conda name: python_abi version: '3.12' @@ -1418,6 +5389,59 @@ packages: license_family: BSD size: 6278 timestamp: 1723823099686 +- kind: conda + name: pytz + version: '2024.1' + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/pytz-2024.1-pyhd8ed1ab_0.conda + sha256: 1a7d6b233f7e6e3bbcbad054c8fd51e690a67b129a899a056a5e45dd9f00cb41 + md5: 3eeeeb9e4827ace8c0c1419c85d590ad + depends: + - python >=3.7 + license: MIT + license_family: MIT + size: 188538 + timestamp: 1706886944988 +- kind: conda + name: pyyaml + version: 6.0.2 + build: py312h024a12e_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/pyyaml-6.0.2-py312h024a12e_1.conda + sha256: b06f1c15fb39695bbf707ae8fb554b9a77519af577b5556784534c7db10b52e3 + md5: 1ee23620cf46cb15900f70a1300bae55 + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + - yaml >=0.2.5,<0.3.0a0 + license: MIT + license_family: MIT + size: 187143 + timestamp: 1725456547263 +- kind: conda + name: pyyaml + version: 6.0.2 + build: py312h66e93f0_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.2-py312h66e93f0_1.conda + sha256: a60705971e958724168f2ebbb8ed4853067f1d3f7059843df3903e3092bbcffa + md5: 549e5930e768548a89c23f595dac5a95 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - yaml >=0.2.5,<0.3.0a0 + license: MIT + license_family: MIT + size: 206553 + timestamp: 1725456256213 - kind: conda name: pyzmq version: 26.2.0 @@ -1460,6 +5484,36 @@ packages: license_family: BSD size: 361674 timestamp: 1728642457661 +- kind: conda + name: re2 + version: 2024.07.02 + build: h77b4e00_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/re2-2024.07.02-h77b4e00_1.conda + sha256: c1721cb80f7201652fc9801f49c214c88aee835d957f2376e301bd40a8415742 + md5: 01093ff37c1b5e6bf9f17c0116747d11 + depends: + - libre2-11 2024.07.02 hbbce691_1 + license: BSD-3-Clause + license_family: BSD + size: 26665 + timestamp: 1728778975855 +- kind: conda + name: re2 + version: 2024.07.02 + build: hcd0e937_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/re2-2024.07.02-hcd0e937_1.conda + sha256: eebddde6cb10b146507810b701ef6df122d5309cd5151a39d0828aa44dc53725 + md5: 19e29f2ccc9168eb0a39dc40c04c0e21 + depends: + - libre2-11 2024.07.02 h2348fd5_1 + license: BSD-3-Clause + license_family: BSD + size: 26860 + timestamp: 1728779123653 - kind: conda name: readline version: '8.2' @@ -1481,16 +5535,161 @@ packages: version: '8.2' build: h92ec313_1 build_number: 1 - subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/readline-8.2-h92ec313_1.conda - sha256: a1dfa679ac3f6007362386576a704ad2d0d7a02e98f5d0b115f207a2da63e884 - md5: 8cbb776a2f641b943d413b3e19df71f4 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/readline-8.2-h92ec313_1.conda + sha256: a1dfa679ac3f6007362386576a704ad2d0d7a02e98f5d0b115f207a2da63e884 + md5: 8cbb776a2f641b943d413b3e19df71f4 + depends: + - ncurses >=6.3,<7.0a0 + license: GPL-3.0-only + license_family: GPL + size: 250351 + timestamp: 1679532511311 +- kind: conda + name: regex + version: 2024.11.6 + build: py312h66e93f0_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/regex-2024.11.6-py312h66e93f0_0.conda + sha256: fcb5687d3ec5fff580b64b8fb649d9d65c999a91a5c3108a313ecdd2de99f06b + md5: 647770db979b43f9c9ca25dcfa7dc4e4 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Python-2.0 + license_family: PSF + size: 402821 + timestamp: 1730952378415 +- kind: conda + name: regex + version: 2024.11.6 + build: py312hea69d52_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/regex-2024.11.6-py312hea69d52_0.conda + sha256: dcdec32f2c7dd37986baa692bedf9db126ad34e92e5e9b64f707cba3d04d2525 + md5: e73cda1f18846b608284bd784f061eac + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: Python-2.0 + license_family: PSF + size: 366374 + timestamp: 1730952427552 +- kind: conda + name: requests + version: 2.32.3 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/requests-2.32.3-pyhd8ed1ab_1.conda + sha256: d701ca1136197aa121bbbe0e8c18db6b5c94acbd041c2b43c70e5ae104e1d8ad + md5: a9b9368f3701a417eac9edbcae7cb737 + depends: + - certifi >=2017.4.17 + - charset-normalizer >=2,<4 + - idna >=2.5,<4 + - python >=3.9 + - urllib3 >=1.21.1,<3 + constrains: + - chardet >=3.0.2,<6 + license: Apache-2.0 + license_family: APACHE + size: 58723 + timestamp: 1733217126197 +- kind: conda + name: rich + version: 13.9.4 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/rich-13.9.4-pyhd8ed1ab_1.conda + sha256: 06a760c5ae572e72e865d5a87e9fe3cc171e1a9c996e63daf3db52ff1a0b4457 + md5: 7aed65d4ff222bfb7335997aa40b7da5 + depends: + - markdown-it-py >=2.2.0 + - pygments >=2.13.0,<3.0.0 + - python >=3.9 + - typing_extensions >=4.0.0,<5.0.0 + license: MIT + license_family: MIT + size: 185646 + timestamp: 1733342347277 +- kind: conda + name: s2n + version: 1.5.10 + build: hb5b8611_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/s2n-1.5.10-hb5b8611_0.conda + sha256: f6d451821fddc26b93f45e9313e1ea15e09e5ef049d4e137413a5225d2a5dfba + md5: 999f3673f2a011f59287f2969e3749e4 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - openssl >=3.4.0,<4.0a0 + license: Apache-2.0 + license_family: Apache + size: 355142 + timestamp: 1734415467047 +- kind: conda + name: safetensors + version: 0.4.5 + build: py312h12e396e_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/safetensors-0.4.5-py312h12e396e_0.conda + sha256: e44515f875c10efb5e041efcb250dfd18f2cb66ec3f268237549ead6284c6922 + md5: 3b87a00bcaab069172d6cef8124b7142 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - __glibc >=2.17 + license: Apache-2.0 + license_family: APACHE + size: 402547 + timestamp: 1725632183154 +- kind: conda + name: safetensors + version: 0.4.5 + build: py312he431725_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/safetensors-0.4.5-py312he431725_0.conda + sha256: 93a085d0d64237db7f4ff395c446f268c575dc2c324d8e3e5c5d7d836896295e + md5: ccb978cf1e3151c25a44c4ae65c1f20e + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + constrains: + - __osx >=11.0 + license: Apache-2.0 + license_family: APACHE + size: 353606 + timestamp: 1725632294079 +- kind: conda + name: shellingham + version: 1.5.4 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/shellingham-1.5.4-pyhd8ed1ab_1.conda + sha256: 0557c090913aa63cdbe821dbdfa038a321b488e22bc80196c4b3b1aace4914ef + md5: 7c3c2a0f3ebdea2bbc35538d162b43bf depends: - - ncurses >=6.3,<7.0a0 - license: GPL-3.0-only - license_family: GPL - size: 250351 - timestamp: 1679532511311 + - python >=3.9 + license: MIT + license_family: MIT + size: 14462 + timestamp: 1733301007770 - kind: conda name: six version: 1.16.0 @@ -1506,6 +5705,89 @@ packages: license_family: MIT size: 14259 timestamp: 1620240338595 +- kind: conda + name: snappy + version: 1.2.1 + build: h8bd8927_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/snappy-1.2.1-h8bd8927_1.conda + sha256: ec91e86eeb2c6bbf09d51351b851e945185d70661d2ada67204c9a6419d282d3 + md5: 3b3e64af585eadfb52bb90b553db5edf + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + license: BSD-3-Clause + license_family: BSD + size: 42739 + timestamp: 1733501881851 +- kind: conda + name: snappy + version: 1.2.1 + build: h98b9ce2_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/snappy-1.2.1-h98b9ce2_1.conda + sha256: 4242f95b215127a006eb664fe26ed5a82df87e90cbdbc7ce7ff4971f0720997f + md5: ded86dee325290da2967a3fea3800eb5 + depends: + - __osx >=11.0 + - libcxx >=18 + license: BSD-3-Clause + license_family: BSD + size: 35857 + timestamp: 1733502172664 +- kind: conda + name: sniffio + version: 1.3.1 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/sniffio-1.3.1-pyhd8ed1ab_1.conda + sha256: c2248418c310bdd1719b186796ae50a8a77ce555228b6acd32768e2543a15012 + md5: bf7a226e58dfb8346c70df36065d86c9 + depends: + - python >=3.9 + license: Apache-2.0 + license_family: Apache + size: 15019 + timestamp: 1733244175724 +- kind: conda + name: sse-starlette + version: 2.2.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/sse-starlette-2.2.0-pyhd8ed1ab_0.conda + sha256: 0c1d5ae5493d0ad7a5d8906230e3e0fb4ecaf0f4fabf57377200dd640e1b6f6a + md5: b0d012dd070ade4c4a7c395104caecc1 + depends: + - anyio >=4.7.0 + - python >=3.9 + - starlette >=0.41.3 + license: BSD-3-Clause + size: 15307 + timestamp: 1734870191367 +- kind: conda + name: starlette + version: 0.41.3 + build: pyha770c72_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/starlette-0.41.3-pyha770c72_1.conda + sha256: b74fc76107487eb26624c01fc55bfab7eed03ae82e003333c86d8a1eeac53672 + md5: 0207dac04ae2200701fab697f0aaaac4 + depends: + - anyio >=3.4.0,<5 + - python >=3.9 + - typing_extensions >=3.10.0 + license: BSD-3-Clause + license_family: BSD + size: 58838 + timestamp: 1733344472634 - kind: conda name: tk version: 8.6.13 @@ -1537,6 +5819,49 @@ packages: license_family: BSD size: 3318875 timestamp: 1699202167581 +- kind: conda + name: tokenizers + version: 0.21.0 + build: py312h8360d73_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/tokenizers-0.21.0-py312h8360d73_0.conda + sha256: 4f504a5e9d77c6d88a8f735c4319429d8bf40b742384f908a2efe0a09acc3cc5 + md5: f953aa733207f3d37acf4a3efbedba89 + depends: + - __glibc >=2.17,<3.0.a0 + - huggingface_hub >=0.16.4,<1.0 + - libgcc >=13 + - libstdcxx >=13 + - openssl >=3.4.0,<4.0a0 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - __glibc >=2.17 + license: Apache-2.0 + license_family: APACHE + size: 2258007 + timestamp: 1732734202127 +- kind: conda + name: tokenizers + version: 0.21.0 + build: py312hf3e4074_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/tokenizers-0.21.0-py312hf3e4074_0.conda + sha256: 5d395333fcb22dc611140286c1f2ea8b3fa220a4931c583587cb612238091555 + md5: 4c732c74b485ef7ac8ec1c548dd45e8e + depends: + - __osx >=11.0 + - huggingface_hub >=0.16.4,<1.0 + - libcxx >=18 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + constrains: + - __osx >=11.0 + license: Apache-2.0 + license_family: APACHE + size: 1931389 + timestamp: 1732734727624 - kind: conda name: tornado version: 6.4.1 @@ -1573,6 +5898,21 @@ packages: license_family: Apache size: 837665 timestamp: 1724956252424 +- kind: conda + name: tqdm + version: 4.67.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.1-pyhd8ed1ab_0.conda + sha256: 5673b7104350a6998cb86cccf1d0058217d86950e8d6c927d8530606028edb1d + md5: 4085c9db273a148e149c03627350e22c + depends: + - colorama + - python >=3.7 + license: MPL-2.0 or MIT + size: 89484 + timestamp: 1732497312317 - kind: conda name: traitlets version: 5.14.3 @@ -1588,6 +5928,118 @@ packages: license_family: BSD size: 110187 timestamp: 1713535244513 +- kind: conda + name: transformers + version: 4.47.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/transformers-4.47.1-pyhd8ed1ab_0.conda + sha256: df8238c3cccbb6bb1d5657e6a75977ac0b832ab61155d5e3d8560c1c4f52abeb + md5: 931d66db156680c42c62812d6533cbf7 + depends: + - datasets !=2.5.0 + - filelock + - huggingface_hub >=0.23.0,<1.0 + - numpy >=1.17 + - packaging >=20.0 + - python >=3.9 + - pyyaml >=5.1 + - regex !=2019.12.17 + - requests + - safetensors >=0.4.1 + - tokenizers >=0.21,<0.22 + - tqdm >=4.27 + license: Apache-2.0 + license_family: APACHE + size: 3680276 + timestamp: 1734499046193 +- kind: conda + name: typer + version: 0.15.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/typer-0.15.1-pyhd8ed1ab_0.conda + sha256: ef695490e895c2ad552c77ec497b899b09fd4ad4ab07edcf5649f5994cf92a35 + md5: 170a0398946d8f5b454e592672b6fc20 + depends: + - python >=3.9 + - typer-slim-standard 0.15.1 hd8ed1ab_0 + license: MIT + license_family: MIT + size: 56175 + timestamp: 1733408582623 +- kind: conda + name: typer-slim + version: 0.15.1 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.15.1-pyhd8ed1ab_0.conda + sha256: d4965516f35e0805199de6596c4ac76c4ad3d6b012be35e532102f9e53ecb860 + md5: 0218b16f5a1dd569e575a7a6415489db + depends: + - click >=8.0.0 + - python >=3.9 + - typing_extensions >=3.7.4.3 + constrains: + - rich >=10.11.0 + - typer >=0.15.1,<0.15.2.0a0 + - shellingham >=1.3.0 + license: MIT + license_family: MIT + size: 43592 + timestamp: 1733408569554 +- kind: conda + name: typer-slim-standard + version: 0.15.1 + build: hd8ed1ab_0 + subdir: noarch + noarch: generic + url: https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.15.1-hd8ed1ab_0.conda + sha256: f31c56fe98315da8b9ce848256c17e0b9f87896b41a6ccf0c9cc74644dcef20f + md5: 4e603c43bfdfc7b533be087c3e070cc9 + depends: + - rich + - shellingham + - typer-slim 0.15.1 pyhd8ed1ab_0 + license: MIT + license_family: MIT + size: 49531 + timestamp: 1733408570063 +- kind: conda + name: typing-extensions + version: 4.12.2 + build: hd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.12.2-hd8ed1ab_1.conda + sha256: c8e9c1c467b5f960b627d7adc1c65fece8e929a3de89967e91ef0f726422fd32 + md5: b6a408c64b78ec7b779a3e5c7a902433 + depends: + - typing_extensions 4.12.2 pyha770c72_1 + license: PSF-2.0 + license_family: PSF + size: 10075 + timestamp: 1733188758872 +- kind: conda + name: typing_extensions + version: 4.12.2 + build: pyha770c72_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_1.conda + sha256: 337be7af5af8b2817f115b3b68870208b30c31d3439bec07bfb2d8f4823e3568 + md5: d17f13df8b65464ca316cbc000a3cb64 + depends: + - python >=3.9 + license: PSF-2.0 + license_family: PSF + size: 39637 + timestamp: 1733188758212 - kind: conda name: tzdata version: 2024b @@ -1600,36 +6052,190 @@ packages: license: LicenseRef-Public-Domain size: 122354 timestamp: 1728047496079 +- kind: conda + name: urllib3 + version: 2.3.0 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.3.0-pyhd8ed1ab_0.conda + sha256: 114919ffa80c328127dab9c8e7a38f9d563c617691fb81fccb11c1e86763727e + md5: 32674f8dbfb7b26410ed580dd3c10a29 + depends: + - brotli-python >=1.0.9 + - h2 >=4,<5 + - pysocks >=1.5.6,<2.0,!=1.5.7 + - python >=3.9 + - zstandard >=0.18.0 + license: MIT + license_family: MIT + size: 100102 + timestamp: 1734859520452 +- kind: conda + name: uvicorn + version: 0.34.0 + build: pyh31011fe_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/uvicorn-0.34.0-pyh31011fe_0.conda + sha256: 55c160b0cf9274e2b98bc0f7fcce548bffa8d788bc86aa02801877457040f6fa + md5: 5d448feee86e4740498ec8f8eb40e052 + depends: + - __unix + - click >=7.0 + - h11 >=0.8 + - python >=3.9 + - typing_extensions >=4.0 + license: BSD-3-Clause + license_family: BSD + size: 48643 + timestamp: 1734293057914 - kind: conda name: weave - version: 0.1.2 + version: 0.1.3 build: h60d57d3_0 subdir: osx-arm64 - url: https://repo.prefix.dev/mojo-community/osx-arm64/weave-0.1.2-h60d57d3_0.conda - sha256: bf022dc93d70febbffdd1dda097c1b829435fb550b872816851dbb2d4f3bcbf6 + url: https://repo.prefix.dev/mojo-community/osx-arm64/weave-0.1.3-h60d57d3_0.conda + sha256: b28f5c30d125a2308985bf2deecc4df72ad61e3f586ff9c5c8d675fd00de4564 depends: - - max >=24.5.0,<25 - - gojo >=0.1.12,<0.2 + - max >=24.6.0 arch: arm64 platform: osx license: MIT - size: 431227 - timestamp: 1727097760766 + size: 705669 + timestamp: 1734476245628 - kind: conda name: weave - version: 0.1.2 + version: 0.1.3 build: hb0f4dca_0 subdir: linux-64 - url: https://repo.prefix.dev/mojo-community/linux-64/weave-0.1.2-hb0f4dca_0.conda - sha256: 38592b2d377cfd18141448a40c72172d1ad3ebfc8ad33f7ae45f9cdb33ac0632 + url: https://repo.prefix.dev/mojo-community/linux-64/weave-0.1.3-hb0f4dca_0.conda + sha256: 947d861f2c2da3ea70038e2d347b370b89f74d3a3d952e05291038429c0fe04a depends: - - max >=24.5.0,<25 - - gojo >=0.1.12,<0.2 + - max >=24.6.0 arch: x86_64 platform: linux license: MIT - size: 431410 - timestamp: 1727097758257 + size: 705648 + timestamp: 1734476233513 +- kind: conda + name: wrapt + version: 1.17.0 + build: py312h66e93f0_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/wrapt-1.17.0-py312h66e93f0_0.conda + sha256: a6fc0f4e90643d0c1fd4aab669b6a79f44a305a5474256f6f2da3354d2310fb4 + md5: ddbe3bb0e1356cb9074dd848570694f9 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-2-Clause + license_family: BSD + size: 63807 + timestamp: 1732523690292 +- kind: conda + name: wrapt + version: 1.17.0 + build: py312hea69d52_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/wrapt-1.17.0-py312hea69d52_0.conda + sha256: 0fb35c3d1642f9f47db87bdb33148f88ef19a3af1eb0ee99b5491551c57269c7 + md5: 73414acdb779a8694a14527865b4357a + depends: + - __osx >=11.0 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: BSD-2-Clause + license_family: BSD + size: 61043 + timestamp: 1732523852129 +- kind: conda + name: xorg-libxau + version: 1.0.12 + build: h5505292_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/xorg-libxau-1.0.12-h5505292_0.conda + sha256: f33e6f013fc36ebc200f09ddead83468544cb5c353a3b50499b07b8c34e28a8d + md5: 50901e0764b7701d8ed7343496f4f301 + depends: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 13593 + timestamp: 1734229104321 +- kind: conda + name: xorg-libxau + version: 1.0.12 + build: hb9d3cd8_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.12-hb9d3cd8_0.conda + sha256: ed10c9283974d311855ae08a16dfd7e56241fac632aec3b92e3cfe73cff31038 + md5: f6ebe2cb3f82ba6c057dde5d9debe4f7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 14780 + timestamp: 1734229004433 +- kind: conda + name: xorg-libxdmcp + version: 1.1.5 + build: hb9d3cd8_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.5-hb9d3cd8_0.conda + sha256: 6b250f3e59db07c2514057944a3ea2044d6a8cdde8a47b6497c254520fade1ee + md5: 8035c64cb77ed555e3f150b7b3972480 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 19901 + timestamp: 1727794976192 +- kind: conda + name: xorg-libxdmcp + version: 1.1.5 + build: hd74edd7_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/xorg-libxdmcp-1.1.5-hd74edd7_0.conda + sha256: 9939a166d780700d81023546759102b33fdc2c5f11ef09f5f66c77210fd334c8 + md5: 77c447f48cab5d3a15ac224edb86a968 + depends: + - __osx >=11.0 + license: MIT + license_family: MIT + size: 18487 + timestamp: 1727795205022 +- kind: conda + name: xxhash + version: 0.8.2 + build: hb547adb_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/xxhash-0.8.2-hb547adb_0.conda + sha256: a70f59f7221ee72c45b39a6b36a33eb9c717ba01921cce1a3c361a4676979a2e + md5: 144cd3b88706507f332f5eb5fb83a33b + license: BSD-2-Clause + license_family: BSD + size: 97593 + timestamp: 1689951969732 +- kind: conda + name: xxhash + version: 0.8.2 + build: hd590300_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/xxhash-0.8.2-hd590300_0.conda + sha256: 6fe74a8fd84ab0dc25e4dc3e0c22388dd8accb212897a208b14fe5d4fbb8fc2f + md5: f08fb5c89edfc4aadee1c81d4cfb1fa1 + depends: + - libgcc-ng >=12 + license: BSD-2-Clause + license_family: BSD + size: 97691 + timestamp: 1689951608120 - kind: conda name: xz version: 5.2.6 @@ -1654,6 +6260,74 @@ packages: license: LGPL-2.1 and GPL-2.0 size: 235693 timestamp: 1660346961024 +- kind: conda + name: yaml + version: 0.2.5 + build: h3422bc3_2 + build_number: 2 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/yaml-0.2.5-h3422bc3_2.tar.bz2 + sha256: 93181a04ba8cfecfdfb162fc958436d868cc37db504c58078eab4c1a3e57fbb7 + md5: 4bb3f014845110883a3c5ee811fd84b4 + license: MIT + license_family: MIT + size: 88016 + timestamp: 1641347076660 +- kind: conda + name: yaml + version: 0.2.5 + build: h7f98852_2 + build_number: 2 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h7f98852_2.tar.bz2 + sha256: a4e34c710eeb26945bdbdaba82d3d74f60a78f54a874ec10d373811a5d217535 + md5: 4cb3ad778ec2d5a7acbdf254eb1c42ae + depends: + - libgcc-ng >=9.4.0 + license: MIT + license_family: MIT + size: 89141 + timestamp: 1641346969816 +- kind: conda + name: yarl + version: 1.18.3 + build: py312h66e93f0_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/yarl-1.18.3-py312h66e93f0_0.conda + sha256: a0d93c3bef723e384cff8a29a82a2c6b7a73b39328088f3a2d97c901f56e9a63 + md5: 91df2efaa08730416bec2a4502309275 + depends: + - __glibc >=2.17,<3.0.a0 + - idna >=2.0 + - libgcc >=13 + - multidict >=4.0 + - propcache >=0.2.1 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: Apache + size: 151393 + timestamp: 1733428897813 +- kind: conda + name: yarl + version: 1.18.3 + build: py312hea69d52_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/yarl-1.18.3-py312hea69d52_0.conda + sha256: 69c7863809e11bc90c0d935c16e7f151dcc925add08b3894f06059263a8cb9ba + md5: f32f9b16361866a62d6e061fcd7eb400 + depends: + - __osx >=11.0 + - idna >=2.0 + - multidict >=4.0 + - propcache >=0.2.1 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: Apache + size: 141556 + timestamp: 1733429104990 - kind: conda name: zeromq version: 4.3.5 @@ -1706,3 +6380,76 @@ packages: license_family: MIT size: 21409 timestamp: 1726248679175 +- kind: conda + name: zstandard + version: 0.23.0 + build: py312h15fbf35_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/zstandard-0.23.0-py312h15fbf35_1.conda + sha256: d00ca25c1e28fd31199b26a94f8c96574475704a825d244d7a6351ad3745eeeb + md5: a4cde595509a7ad9c13b1a3809bcfe51 + depends: + - __osx >=11.0 + - cffi >=1.11 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + - zstd >=1.5.6,<1.5.7.0a0 + - zstd >=1.5.6,<1.6.0a0 + license: BSD-3-Clause + license_family: BSD + size: 330788 + timestamp: 1725305806565 +- kind: conda + name: zstandard + version: 0.23.0 + build: py312hef9b889_1 + build_number: 1 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/zstandard-0.23.0-py312hef9b889_1.conda + sha256: b97015e146437283f2213ff0e95abdc8e2480150634d81fbae6b96ee09f5e50b + md5: 8b7069e9792ee4e5b4919a7a306d2e67 + depends: + - __glibc >=2.17,<3.0.a0 + - cffi >=1.11 + - libgcc >=13 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - zstd >=1.5.6,<1.5.7.0a0 + - zstd >=1.5.6,<1.6.0a0 + license: BSD-3-Clause + license_family: BSD + size: 419552 + timestamp: 1725305670210 +- kind: conda + name: zstd + version: 1.5.6 + build: ha6fb4c9_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.6-ha6fb4c9_0.conda + sha256: c558b9cc01d9c1444031bd1ce4b9cff86f9085765f17627a6cd85fc623c8a02b + md5: 4d056880988120e29d75bfff282e0f45 + depends: + - libgcc-ng >=12 + - libstdcxx-ng >=12 + - libzlib >=1.2.13,<2.0.0a0 + license: BSD-3-Clause + license_family: BSD + size: 554846 + timestamp: 1714722996770 +- kind: conda + name: zstd + version: 1.5.6 + build: hb46c0d2_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/zstd-1.5.6-hb46c0d2_0.conda + sha256: 2d4fd1ff7ee79cd954ca8e81abf11d9d49954dd1fef80f27289e2402ae9c2e09 + md5: d96942c06c3e84bfcc5efb038724a7fd + depends: + - __osx >=11.0 + - libzlib >=1.2.13,<2.0.0a0 + license: BSD-3-Clause + license_family: BSD + size: 405089 + timestamp: 1714723101397 diff --git a/mojoproject.toml b/mojoproject.toml index ffd3375..80ae59f 100644 --- a/mojoproject.toml +++ b/mojoproject.toml @@ -4,7 +4,7 @@ channels = ["https://repo.prefix.dev/mojo-community", "conda-forge", "https://co description = "A Budding CLI Library!" name = "prism" platforms = ["osx-arm64", "linux-64"] -version = "0.2.1" +version = "0.2.2" license = "MIT" license-file = "LICENSE" homepage = "https://github.com/thatstoasty/prism" @@ -20,6 +20,5 @@ publish = { cmd = "python scripts/util.py publish", env = { PREFIX_API_KEY = "$P bp = { depends_on=["build", "publish"] } [dependencies] -max = ">=24.5.0,<25" -gojo = ">=0.1.12,<0.2" -mog = ">=0.1.6,<0.2" +max = ">=24.6.0" +mog = ">=0.1.7" diff --git a/scripts/examples.sh b/scripts/examples.sh deleted file mode 100755 index ce63c07..0000000 --- a/scripts/examples.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -TEMP_DIR=~/tmp -PACKAGE_NAME=prism -mkdir -p $TEMP_DIR - -echo "[INFO] Building $PACKAGE_NAME package and example binaries." -magic run mojo package src/$PACKAGE_NAME -o $TEMP_DIR/$PACKAGE_NAME.mojopkg -cp -a examples/. $TEMP_DIR -magic run mojo build $TEMP_DIR/aliases.mojo -o $TEMP_DIR/aliases -magic run mojo build $TEMP_DIR/hello_world.mojo -o $TEMP_DIR/hello_world -magic run mojo build $TEMP_DIR/fg_parent.mojo -o $TEMP_DIR/parent -magic run mojo build $TEMP_DIR/fg_child.mojo -o $TEMP_DIR/child -magic run mojo build $TEMP_DIR/arg_validators.mojo -o $TEMP_DIR/validators - -echo "[INFO] Running examples..." -# Need to run these first examples as part of a mojo project as they have external dependencies. -# printer is a portable binary, but nested and persistent_flags are not because they depend on a python library. -# cd examples/printer -# magic run mojo build printer.mojo -# ./printer "sample-text" --formatting=underline - -# cd ../requests -# magic run mojo build nested.mojo -# magic run nested get cat --count 3 -l -# magic run mojo build persistent_flags.mojo -o persistent -# magic run persistent get cat --count 2 --lover -# magic run persistent get dog - -cd ../.. - -$TEMP_DIR/aliases my thing -$TEMP_DIR/hello_world say hello -$TEMP_DIR/parent --required --host=www.example.com --port 8080 -$TEMP_DIR/parent --required --host www.example.com -$TEMP_DIR/parent --required --host www.example.com --uri abcdef --port 8080 -$TEMP_DIR/parent -$TEMP_DIR/child tool --required -a --host=www.example.com --port 8080 -$TEMP_DIR/child tool --required -a --host www.example.com -$TEMP_DIR/child tool --required --also --host www.example.com --uri abcdef --port 8080 -$TEMP_DIR/validators Hello from Mojo! -$TEMP_DIR/validators no_args Hello from Mojo! -$TEMP_DIR/validators valid_args Hello from Mojo! -$TEMP_DIR/validators minimum_n_args Hello from Mojo! -$TEMP_DIR/validators maximum_n_args Hello from Mojo! -$TEMP_DIR/validators exact_args Hello from Mojo! -$TEMP_DIR/validators range_args Hello from Mojo! - -echo "[INFO] Cleaning up the example directory." -rm -R $TEMP_DIR diff --git a/scripts/publish.sh b/scripts/publish.sh deleted file mode 100644 index 7d99e48..0000000 --- a/scripts/publish.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# ignore errors because we want to ignore duplicate packages -for file in $CONDA_BLD_PATH/**/*.conda; do - magic run rattler-build upload prefix -c "mojo-community" "$file" || true -done diff --git a/scripts/tests.sh b/scripts/tests.sh deleted file mode 100755 index 5ab4130..0000000 --- a/scripts/tests.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -TEMP_DIR=~/tmp -PACKAGE_NAME=prism -mkdir -p $TEMP_DIR - -echo "[INFO] Building $PACKAGE_NAME package and copying tests." -cp -a test/. $TEMP_DIR -magic run mojo package src/$PACKAGE_NAME -o $TEMP_DIR/$PACKAGE_NAME.mojopkg - -echo "[INFO] Running tests..." -magic run mojo test $TEMP_DIR - -echo "[INFO] Cleaning up the test directory." -rm -R $TEMP_DIR diff --git a/scripts/util.py b/scripts/util.py index edfd7d4..8ea13db 100644 --- a/scripts/util.py +++ b/scripts/util.py @@ -55,6 +55,11 @@ def generate_recipe(args: Any) -> None: .replace("{{VERSION}}", config["project"]["version"]) ) + if args.mode != "default": + recipe = recipe.replace("{{ENVIRONMENT_FLAG}}", f"-e {args.mode}") + else: + recipe = recipe.replace("{{ENVIRONMENT_FLAG}}", "") + # Dependencies are the only notable field that changes between environments. dependencies: dict[str, str] match args.mode: @@ -79,10 +84,10 @@ def publish_to_prefix(args: Any) -> None: raise ValueError("CONDA_BLD_PATH environment variable is not set. This ") print(f"Publishing packages to: {args.channel}") - for file in glob.glob(f"{conda_build_path}/**/*.conda"): + for file in glob.glob(f'{conda_build_path}/**/*.conda'): try: subprocess.run( - ["magic", "run", "rattler-build", "upload", "prefix", "-c", args.channel, file], + ["rattler-build", "upload", "prefix", "-c", args.channel, file], check=True, ) except subprocess.CalledProcessError: @@ -98,8 +103,7 @@ def remove_temp_directory() -> None: def prepare_temp_directory() -> None: - """Creates the temporary directory used for building the package. Adds the compiled mojo package to the directory. - """ + """Creates the temporary directory used for building the package. Adds the compiled mojo package to the directory.""" package = load_project_config()["project"]["name"] remove_temp_directory() os.mkdir(TEMP_DIR) @@ -117,35 +121,62 @@ def execute_package_tests(args: Any) -> None: prepare_temp_directory() shutil.copytree(TEST_DIR, TEMP_DIR, dirs_exist_ok=True) - print("Running tests...") - subprocess.run(["mojo", "test", TEMP_DIR], check=True) + target = TEMP_DIR + if args.path: + target = f"{target}/{args.path}" + print(f"Running tests at {target}...") + subprocess.run(["mojo", "test", target], check=True) remove_temp_directory() def execute_package_examples(args: Any) -> None: """Executes the examples for the package.""" - EXAMPLE_DIR = "./examples" + EXAMPLE_DIR = "examples" + if not os.path.exists("examples"): + print(f"Path does not exist: {EXAMPLE_DIR}.") + return print("Building package and copying examples.") prepare_temp_directory() - shutil.copytree(EXAMPLE_DIR, TEMP_DIR) + shutil.copytree(EXAMPLE_DIR, TEMP_DIR, dirs_exist_ok=True) + + example_files = f'{EXAMPLE_DIR}/*.mojo' + if args.path: + example_files = f"{EXAMPLE_DIR}/{args.path}" - print("Running examples...") - subprocess.run(["mojo", "test", TEMP_DIR], check=True) + print(f"Running examples in {example_files}...") + for file in glob.glob(example_files): + file_name = os.path.basename(file) + name, _ = os.path.splitext(file_name) + shutil.copyfile(file, f"{TEMP_DIR}/{file_name}") + subprocess.run(["mojo", "build", f"{TEMP_DIR}/{file_name}", "-o", f"{TEMP_DIR}/{name}"], check=True) + subprocess.run([f"{TEMP_DIR}/{name}"], check=True) remove_temp_directory() def execute_package_benchmarks(args: Any) -> None: BENCHMARK_DIR = "./benchmarks" + if not os.path.exists("benchmarks"): + print(f"Path does not exist: {BENCHMARK_DIR}.") + return print("Building package and copying benchmarks.") prepare_temp_directory() - shutil.copytree(BENCHMARK_DIR, TEMP_DIR) + shutil.copytree(BENCHMARK_DIR, TEMP_DIR, dirs_exist_ok=True) + + benchmark_files = f'{BENCHMARK_DIR}/*.mojo' + if args.path: + benchmark_files = f"{BENCHMARK_DIR}/{args.path}" - print("Running benchmarks...") - subprocess.run(["mojo", "test", TEMP_DIR], check=True) + print(f"Running benchmarks in {benchmark_files}...") + for file in glob.glob(benchmark_files): + file_name = os.path.basename(file) + name, _ = os.path.splitext(file_name) + shutil.copyfile(file, f"{TEMP_DIR}/{file_name}") + subprocess.run(["mojo", "build", f"{TEMP_DIR}/{file_name}", "-o", f"{TEMP_DIR}/{name}"], check=True) + subprocess.run([f"{TEMP_DIR}/{name}"], check=True) remove_temp_directory() @@ -155,11 +186,14 @@ def build_conda_package(args: Any) -> None: # Build the conda package for the project. config = load_project_config() channels: list[str] + rattler_command: list[str] match args.mode: case "default": channels = config["project"]["channels"] + rattler_command = ["magic", "run", "rattler-build", "build"] case _: channels = config["feature"][args.mode]["channels"] + rattler_command = ["magic", "run", "-e", args.mode, "rattler-build", "build"] options: list[str] = [] for channel in channels: @@ -167,7 +201,7 @@ def build_conda_package(args: Any) -> None: generate_recipe(args) subprocess.run( - ["magic", "run", "rattler-build", "build", "-r", RECIPE_DIR, "--skip-existing=all", *options], + [*rattler_command, "-r", RECIPE_DIR, "--skip-existing=all", *options], check=True, ) os.remove(f"{RECIPE_DIR}/recipe.yaml") @@ -176,7 +210,9 @@ def build_conda_package(args: Any) -> None: def main(): # Configure the parser to receive the mode argument. # create the top-level parser - parser = argparse.ArgumentParser(prog="util", description="Generate a recipe for the project.") + parser = argparse.ArgumentParser( + prog="util", description="Generate a recipe for the project." + ) subcommands = parser.add_subparsers(help="sub-command help") # create the parser for the "templater" command @@ -218,14 +254,35 @@ def main(): # create the parser for the "run tests" command run_tests = run_subcommands.add_parser("tests", help="tests help") + run_tests.add_argument( + "-p", + "--path", + type=str, + default=None, + help="Optional path to test file or test directory to run tests for.", + ) run_tests.set_defaults(func=execute_package_tests) # create the parser for the "run benchmarks" command run_benchmarks = run_subcommands.add_parser("benchmarks", help="benchmarks help") + run_benchmarks.add_argument( + "-p", + "--path", + type=str, + default=None, + help="Optional path to benchmark file or test directory to run tests for.", + ) run_benchmarks.set_defaults(func=execute_package_benchmarks) # create the parser for the "run examples" command run_examples = run_subcommands.add_parser("examples", help="examples help") + run_examples.add_argument( + "-p", + "--path", + type=str, + default=None, + help="Optional path to example file or test directory to run tests for.", + ) run_examples.set_defaults(func=execute_package_examples) args = parser.parse_args() diff --git a/src/prism/args.mojo b/src/prism/args.mojo index c25557c..790c31e 100644 --- a/src/prism/args.mojo +++ b/src/prism/args.mojo @@ -1,6 +1,5 @@ -from memory.arc import Arc +from memory import ArcPointer from collections.optional import Optional -import gojo.fmt from .command import ArgValidatorFn from .context import Context @@ -12,7 +11,7 @@ fn no_args(ctx: Context) raises -> None: ctx: The context of the command being executed. """ if len(ctx.args) > 0: - raise Error(fmt.sprintf("The command `%s` does not take any arguments.", ctx.command[].name)) + raise Error("The command `{}` does not take any arguments.".format(ctx.command[].name)) fn arbitrary_args(ctx: Context) raises -> None: @@ -27,7 +26,7 @@ fn arbitrary_args(ctx: Context) raises -> None: fn minimum_n_args[n: Int]() -> ArgValidatorFn: """Returns an error if there is not at least n arguments. - Params: + Parameters: n: The minimum number of arguments. Returns: @@ -37,8 +36,7 @@ fn minimum_n_args[n: Int]() -> ArgValidatorFn: fn less_than_n_args(ctx: Context) raises -> None: if len(ctx.args) < n: raise Error( - fmt.sprintf( - "The command `%s` accepts at least %d argument(s). Received: %d.", + "The command `{}` accepts at least {} argument(s). Received: {}.".format( ctx.command[].name, n, len(ctx.args), @@ -51,7 +49,7 @@ fn minimum_n_args[n: Int]() -> ArgValidatorFn: fn maximum_n_args[n: Int]() -> ArgValidatorFn: """Returns an error if there are more than n arguments. - Params: + Parameters: n: The maximum number of arguments. Returns: @@ -61,8 +59,7 @@ fn maximum_n_args[n: Int]() -> ArgValidatorFn: fn more_than_n_args(ctx: Context) raises -> None: if len(ctx.args) > n: raise Error( - fmt.sprintf( - "The command `%s` accepts at most %d argument(s). Received: %d.", + "The command `{}` accepts at most {} argument(s). Received: {}.".format( ctx.command[].name, n, len(ctx.args), @@ -75,7 +72,7 @@ fn maximum_n_args[n: Int]() -> ArgValidatorFn: fn exact_args[n: Int]() -> ArgValidatorFn: """Returns an error if there are not exactly n arguments. - Params: + Parameters: n: The number of arguments. Returns: @@ -85,8 +82,7 @@ fn exact_args[n: Int]() -> ArgValidatorFn: fn exactly_n_args(ctx: Context) raises -> None: if len(ctx.args) != n: raise Error( - fmt.sprintf( - "The command `%s` accepts exactly %d argument(s). Received: %d.", + "The command `{}` accepts exactly {} argument(s). Received: {}.".format( ctx.command[].name, n, len(ctx.args), @@ -105,13 +101,13 @@ fn valid_args(ctx: Context) raises -> None: if ctx.command[].valid_args: for arg in ctx.args: if arg[] not in ctx.command[].valid_args: - raise Error(fmt.sprintf("Invalid argument: `%s`, for the command `%s`.", arg[], ctx.command[].name)) + raise Error("Invalid argument: `{}`, for the command `{}`.".format(arg[], ctx.command[].name)) fn range_args[minimum: Int, maximum: Int]() -> ArgValidatorFn: """Returns an error if there are not exactly n arguments. - Params: + Parameters: minimum: The minimum number of arguments. maximum: The maximum number of arguments. @@ -122,8 +118,7 @@ fn range_args[minimum: Int, maximum: Int]() -> ArgValidatorFn: fn range_n_args(ctx: Context) raises -> None: if len(ctx.args) < minimum or len(ctx.args) > maximum: raise Error( - fmt.sprintf( - "The command `%s`, accepts between %d to %d argument(s). Received: %d.", + "The command `{}`, accepts between {} to {} argument(s). Received: {}.".format( ctx.command[].name, minimum, maximum, @@ -139,7 +134,7 @@ fn range_args[minimum: Int, maximum: Int]() -> ArgValidatorFn: # fn match_all[arg_validators: List[ArgValidatorFn]]() -> ArgValidatorFn: # """Returns an error if any of the arg_validators return an error. -# Params: +# Parameters: # arg_validators: A list of ArgValidatorFn functions that check the arguments. # Returns: diff --git a/src/prism/command.mojo b/src/prism/command.mojo index e0f7240..9fca6cc 100644 --- a/src/prism/command.mojo +++ b/src/prism/command.mojo @@ -1,10 +1,8 @@ from sys import argv from collections import Optional, Dict, InlineList -from memory.arc import Arc +from memory import ArcPointer from os import abort import mog -import gojo.fmt -from gojo.strings import StringBuilder from .util import to_string, to_list from .flag import Flag from .flag_set import FlagSet, validate_required_flags, REQUIRED, REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE @@ -14,21 +12,32 @@ from .context import Context fn concat_names(flag_names: VariadicListMem[String, _]) -> String: - result = String() - writer = result._unsafe_to_formatter() + """Concatenates the flag names into a single string. + + Args: + flag_names: The flag names to concatenate. + + Returns: + The concatenated flag names. + """ + var result = String() for i in range(len(flag_names)): - writer.write(flag_names[i]) + result.write(flag_names[i]) if i != len(flag_names) - 1: - writer.write(" ") + result.write(" ") return result fn get_args_as_list() -> List[String]: - """Returns the arguments passed to the executable as a list of strings.""" - args = argv() - result = List[String](capacity=len(args)) - i = 1 + """Returns the arguments passed to the executable as a list of strings. + + Returns: + The arguments passed to the executable as a list of strings. + """ + var args = argv() + var result = List[String](capacity=len(args)) + var i = 1 while i < len(args): result.append(args[i]) i += 1 @@ -39,52 +48,58 @@ fn get_args_as_list() -> List[String]: alias NEWLINE = ord("\n") -fn default_help(inout command: Arc[Command]) -> String: +fn default_help(mut command: ArcPointer[Command]) raises -> String: """Prints the help information for the command. - TODO: Add padding for commands, options, and aliases. + + Args: + command: The command to generate help information for. + + Returns: + The help information for the command. + + Raises: + Any error that occurs while generating the help information. """ - usage_style = mog.Style().border(mog.HIDDEN_BORDER) - border_style = mog.Style().border(mog.ROUNDED_BORDER).border_foreground(mog.Color(0x383838)).padding(0, 1) - option_style = mog.Style().foreground(mog.Color(0x81C8BE)) - bold_style = mog.Style().bold() + var usage_style = mog.Style().border(mog.HIDDEN_BORDER) + var border_style = mog.Style().border(mog.ROUNDED_BORDER).border_foreground(mog.Color(0x383838)).padding(0, 1) + var option_style = mog.Style().foreground(mog.Color(0x81C8BE)) + var bold_style = mog.Style().bold() - cmd = command - builder = StringBuilder() - _ = builder.write_string(mog.Style().bold().foreground(mog.Color(0xE5C890)).render("Usage: ")) - _ = builder.write_string(bold_style.render(cmd[].full_name())) + var cmd = command + var builder = String() + builder.write(mog.Style().bold().foreground(mog.Color(0xE5C890)).render("Usage: ")) + builder.write(bold_style.render(cmd[].full_name())) if len(cmd[].flags) > 0: - _ = builder.write_string(" [OPTIONS]") + builder.write(" [OPTIONS]") if len(cmd[].children) > 0: - _ = builder.write_string(" COMMAND") - _ = builder.write_string(" [ARGS]...") + builder.write(" COMMAND") + builder.write(" [ARGS]...") - usage = usage_style.render(mog.join_vertical(mog.left, str(builder), "\n", cmd[].usage)) + var usage = usage_style.render(mog.join_vertical(mog.left, builder, "\n", cmd[].usage)) - builder = StringBuilder() + builder = String() if cmd[].flags.flags: - _ = builder.write_string(bold_style.render("Options")) + builder.write(bold_style.render("Options")) for flag in cmd[].flags.flags: - _ = builder.write_string(option_style.render(fmt.sprintf("\n-%s, --%s", flag[].shorthand, flag[].name))) - _ = builder.write_string(fmt.sprintf(" %s", flag[].usage)) - options = border_style.render(str(builder)) + builder.write(option_style.render("\n-{}, --{}".format(flag[].shorthand, flag[].name))) + builder.write(" {}".format(flag[].usage)) + var options = border_style.render(builder) - builder = StringBuilder() + builder = String() if cmd[].children: - _ = builder.write_string(bold_style.render("Commands")) + builder.write(bold_style.render("Commands")) for i in range(len(cmd[].children)): - _ = builder.write_string( - fmt.sprintf("\n%s %s", option_style.render(cmd[].children[i][].name), cmd[].children[i][].usage) - ) + builder.write("\n{} {}".format(option_style.render(cmd[].children[i][].name), cmd[].children[i][].usage)) if i == len(cmd[].children) - 1: - _ = builder.write_byte(NEWLINE) + builder.write("\n") if cmd[].aliases: - _ = builder.write_string(bold_style.render("Aliases")) - _ = builder.write_string(fmt.sprintf("\n%s", option_style.render(cmd[].aliases.__str__()))) + builder.write(bold_style.render("Aliases")) + builder.write("\n{}".format(option_style.render(cmd[].aliases.__str__()))) - commands = border_style.render(str(builder)) + var commands = border_style.render(builder) return mog.join_vertical(mog.left, usage, options, commands) @@ -92,11 +107,11 @@ alias CmdFn = fn (ctx: Context) -> None """The function for a command to run.""" alias RaisingCmdFn = fn (ctx: Context) raises -> None """The function for a command to run that can error.""" -alias HelpFn = fn (inout command: Arc[Command]) -> String +alias HelpFn = fn (mut command: ArcPointer[Command]) raises -> String """The function to generate help output.""" alias ArgValidatorFn = fn (ctx: Context) raises -> None """The function for an argument validator.""" -alias ParentVisitorFn = fn (parent: Arc[Command]) capturing -> None +alias ParentVisitorFn = fn (parent: ArcPointer[Command]) capturing -> None """The function for visiting parents of a command.""" # TODO: For now it's locked to False until file scope variables. @@ -106,11 +121,11 @@ If False, starts from the child command and goes up the parent chain. If True, s @value -struct Command(CollectionElement): +struct Command(CollectionElement, Writable, Stringable): """A struct representing a command that can be executed from the command line. ```mojo - from memory import Arc + from memory import ArcPointer from prism import Command, Context fn test(ctx: Context) -> None: @@ -182,14 +197,14 @@ struct Command(CollectionElement): var _inherited_flags: FlagSet """Cached results from self._merge_flags().""" - var children: List[Arc[Self]] + var children: List[ArcPointer[Self]] """Child commands.""" # TODO: An optional pointer would be great, but it breaks the compiler. So a list of 0-1 pointers is used. - var parent: List[Arc[Self]] + var parent: List[ArcPointer[Self]] """Parent command.""" fn __init__( - inout self, + mut self, name: String, usage: String, aliases: List[String] = List[String](), @@ -205,11 +220,12 @@ struct Command(CollectionElement): persistent_raising_pre_run: Optional[RaisingCmdFn] = None, persistent_raising_post_run: Optional[RaisingCmdFn] = None, ): - """ + """Constructs a new `Command`. + Args: name: The name of the command. usage: The usage of the command. - arg_validator: The function to validate the arguments passed to the command. + aliases: The aliases for the command. valid_args: The valid arguments for the command. run: The function to run when the command is executed. pre_run: The function to run before the command is executed. @@ -217,11 +233,10 @@ struct Command(CollectionElement): raising_run: The function to run when the command is executed that returns an error. raising_pre_run: The function to run before the command is executed that returns an error. raising_post_run: The function to run after the command is executed that returns an error. - persisting_pre_run: The function to run before the command is executed. This persists to children. - persisting_post_run: The function to run after the command is executed. This persists to children. - persisting_raising_pre_run: The function to run before the command is executed that returns an error. This persists to children. - persisting_raising_post_run: The function to run after the command is executed that returns an error. This persists to children. - help: The function to generate help text for the command. + persistent_pre_run: The function to run before the command is executed. This persists to children. + persistent_post_run: The function to run after the command is executed. This persists to children. + persistent_raising_pre_run: The function to run before the command is executed that returns an error. This persists to children. + persistent_raising_post_run: The function to run after the command is executed that returns an error. This persists to children. """ if not run and not raising_run: abort("A command must have a run or raising_run function.") @@ -248,8 +263,8 @@ struct Command(CollectionElement): self.arg_validator = arbitrary_args self.valid_args = valid_args - self.children = List[Arc[Self]]() - self.parent = List[Arc[Self]]() + self.children = List[ArcPointer[Self]]() + self.parent = List[ArcPointer[Self]](capacity=1) # These need to be mutable so we can add flags to them. self.flags = FlagSet() @@ -258,7 +273,12 @@ struct Command(CollectionElement): self._inherited_flags = FlagSet() self.flags.bool_flag(name="help", shorthand="h", usage="Displays help information about the command.") - fn __moveinit__(inout self, owned existing: Self): + fn __moveinit__(mut self, owned existing: Self): + """Initializes a new `Command` by moving the fields from an existing `Command`. + + Args: + existing: The existing `Command` to move the fields from. + """ self.name = existing.name^ self.usage = existing.usage^ self.aliases = existing.aliases^ @@ -289,18 +309,22 @@ struct Command(CollectionElement): self.parent = existing.parent^ fn __str__(self) -> String: - output = String() - writer = output._unsafe_to_formatter() - self.format_to(writer) - return output + """Returns a string representation of the `Command`. + + Returns: + The string representation of the `Command`. + """ + return String.write(self) - fn format_to(self, inout writer: Formatter): + fn write_to[W: Writer, //](self, mut writer: W): """Write Flag string representation to a `Formatter`. + Parameters: + W: The type of writer to write to. + Args: writer: The formatter to write to. """ - @parameter fn write_optional(opt: Optional[String]): if opt: @@ -326,23 +350,40 @@ struct Command(CollectionElement): writer.write(")") fn full_name(self) -> String: - """Traverses up the parent command tree to build the full command as a string.""" + """Traverses up the parent command tree to build the full command as a string. + + Returns: + The full command name. + """ if self.has_parent(): - ancestor = self.parent[0][].full_name() - return ancestor + " " + self.name + return String.write(self.parent[0][].full_name(), " ", self.name) else: return self.name - fn root(self) -> Arc[Command]: - """Returns the root command of the command tree.""" + fn root(self) -> ArcPointer[Command]: + """Returns the root command of the command tree. + + Returns: + The root command in the tree. + """ if self.has_parent(): return self.parent[0][].root() - return self fn _parse_command( - self, command: Self, arg: String, children: List[Arc[Self]], inout leftover_start: Int - ) -> (Self, List[Arc[Self]]): + self, command: Self, arg: String, children: List[ArcPointer[Self]], mut leftover_start: Int + ) -> (Self, List[ArcPointer[Self]]): + """Traverses the command tree to find the command that matches the given argument. + + Args: + command: The current command being traversed. + arg: The argument to match against the command name or aliases. + children: The children of the current command. + leftover_start: The index to start the remaining arguments at. + + Returns: + The command that matches the argument and the remaining children to traverse. + """ for command_ref in children: if command_ref[][].name == arg or arg in command_ref[][].aliases: leftover_start += 1 @@ -351,14 +392,21 @@ struct Command(CollectionElement): return command, children fn _parse_command_from_args(self, args: List[String]) -> (Self, List[String]): + """Traverses the command tree to find the command that matches the given arguments. + + Args: + args: The arguments to traverse the command tree with. + + Returns: + The command that matches the arguments and the remaining arguments to pass to that command. + """ # If there's no children, then the root command is used. if not self.children or not args: return self, args - command = self - children = self.children - leftover_start = 0 # Start at 1 to start slice at the first remaining arg, not the last child command. - + var command = self + var children = self.children + var leftover_start = 0 # Start at 1 to start slice at the first remaining arg, not the last child command. for arg in args: command, children = self._parse_command(command, arg[], children, leftover_start) @@ -366,14 +414,22 @@ struct Command(CollectionElement): return self, args # If the there are more or equivalent args to the index, then there are remaining args to pass to the command. - remaining_args = List[String]() + var remaining_args = List[String]() if len(args) >= leftover_start: remaining_args = args[leftover_start : len(args)] return command, remaining_args - fn _execute_pre_run_hooks(self, ctx: Context, parents: List[Arc[Self]]) raises -> None: - """Runs the pre-run hooks for the command.""" + fn _execute_pre_run_hooks(self, ctx: Context, parents: List[ArcPointer[Self]]) raises -> None: + """Runs the pre-run hooks for the command. + + Args: + ctx: The context of the command being executed. + parents: The parents of the command to check for persistent pre-run hooks. + + Raises: + Any error that occurs while running the pre-run hooks. + """ try: # Run the persistent pre-run hooks. for parent in parents: @@ -397,11 +453,19 @@ struct Command(CollectionElement): elif ctx.command[].raising_pre_run: ctx.command[].raising_pre_run.value()(ctx) except e: - print("Failed to run pre-run hooks for command: " + ctx.command[].name) + print("Failed to run pre-run hooks for command: " + ctx.command[].name, file=2) raise e - fn _execute_post_run_hooks(self, ctx: Context, parents: List[Arc[Self]]) raises -> None: - """Runs the pre-run hooks for the command.""" + fn _execute_post_run_hooks(self, ctx: Context, parents: List[ArcPointer[Self]]) raises -> None: + """Runs the post-run hooks for the command. + + Args: + ctx: The context of the command being executed. + parents: The parents of the command to check for persistent post-run hooks. + + Raises: + Any error that occurs while running the post-run hooks. + """ try: # Run the persistent post-run hooks. for parent in parents: @@ -436,7 +500,7 @@ struct Command(CollectionElement): # Always execute from the root command, regardless of what command was executed in main. if self.has_parent(): - root = self.root() + var root = self.root() return root[].execute() command, remaining_args = self._parse_command_from_args(get_args_as_list()) @@ -445,10 +509,10 @@ struct Command(CollectionElement): command._merge_flags() # Add all parents to the list to check if they have persistent pre/post hooks. - parents = List[Arc[Self]]() + var parents = List[ArcPointer[Self]]() @parameter - fn append_parents(parent: Arc[Self]) capturing -> None: + fn append_parents(parent: ArcPointer[Self]) capturing -> None: parents.append(parent) command.visit_parents[append_parents]() @@ -461,11 +525,11 @@ struct Command(CollectionElement): try: # Get the flags for the command to be executed. - remaining_args = command.flags.from_args(remaining_args) + var remaining_args = command.flags.from_args(remaining_args) # Check if the help flag was passed - help_passed = command.flags.get_bool("help") - command_ref = Arc(command) + var help_passed = command.flags.get_bool("help") + var command_ref = ArcPointer(command) if help_passed == True: print(command.help(command_ref)) return None @@ -477,7 +541,7 @@ struct Command(CollectionElement): validate_flag_groups(command.flags) # Run flag actions if they have any - ctx = Context(command_ref, remaining_args) + var ctx = Context(command_ref, remaining_args) @parameter fn run_action(flag: Flag) raises -> None: @@ -505,35 +569,36 @@ struct Command(CollectionElement): Returns: The flags for the command and its parent. """ - i_flags = FlagSet() - - @always_inline - fn add_parent_persistent_flags(parent: Arc[Self]) capturing -> None: - cmd = parent - if cmd[].persistent_flags: - i_flags += cmd[].persistent_flags + var flags = FlagSet() + @parameter + fn add_parent_persistent_flags(parent: ArcPointer[Self]) capturing -> None: + if parent[].persistent_flags: + flags += parent[].persistent_flags + self.visit_parents[add_parent_persistent_flags]() + return flags - return i_flags - - fn _merge_flags(inout self): + fn _merge_flags(mut self): """Returns all flags for the command and inherited flags from its parent.""" self.flags += self.persistent_flags self._inherited_flags = self.inherited_flags() self.flags += self._inherited_flags - fn add_subcommand(inout self: Self, inout command: Arc[Self]): + fn add_subcommand(mut self, mut command: ArcPointer[Self]): """Adds child command and set's child's parent attribute to self. Args: command: The command to add as a child of self. """ self.children.append(command) - command[].parent = self + if command[].parent: + command[].parent[0] = self + else: + command[].parent.append(self) - fn mark_flag_required(inout self, flag_name: String) -> None: - """Marks the given flag with annotations so that Prism errors + fn mark_flag_required(mut self, flag_name: String) -> None: + """Marks the given flag with annotations so that `Prism` errors if the command is invoked without the flag. Args: @@ -544,55 +609,53 @@ struct Command(CollectionElement): except e: abort(e) - fn mark_flags_required_together(inout self, *flag_names: String) -> None: - """Marks the given flags with annotations so that Prism errors + fn mark_flags_required_together(mut self, *flag_names: String) -> None: + """Marks the given flags with annotations so that `Prism` errors if the command is invoked with a subset (but not all) of the given flags. Args: flag_names: The names of the flags to mark as required together. """ self._merge_flags() - names = concat_names(flag_names) - + var names = concat_names(flag_names) try: for flag_name in flag_names: self.flags.set_as[REQUIRED_AS_GROUP](flag_name[], names) except e: abort(e) - fn mark_flags_one_required(inout self, *flag_names: String) -> None: - """Marks the given flags with annotations so that Prism errors + fn mark_flags_one_required(mut self, *flag_names: String) -> None: + """Marks the given flags with annotations so that `Prism` errors if the command is invoked without at least one flag from the given set of flags. Args: flag_names: The names of the flags to mark as required. """ self._merge_flags() - names = concat_names(flag_names) + var names = concat_names(flag_names) try: for flag_name in flag_names: self.flags.set_as[ONE_REQUIRED](flag_name[], names) except e: abort(e) - fn mark_flags_mutually_exclusive(inout self, *flag_names: String) -> None: - """Marks the given flags with annotations so that Prism errors + fn mark_flags_mutually_exclusive(mut self, *flag_names: String) -> None: + """Marks the given flags with annotations so that `Prism` errors if the command is invoked with more than one flag from the given set of flags. Args: flag_names: The names of the flags to mark as mutually exclusive. """ self._merge_flags() - names = concat_names(flag_names) - + var names = concat_names(flag_names) try: for flag_name in flag_names: self.flags.set_as[MUTUALLY_EXCLUSIVE](flag_name[], names) except e: abort(e) - fn mark_persistent_flag_required(inout self, flag_name: String) -> None: - """Marks the given persistent flag with annotations so that Prism errors + fn mark_persistent_flag_required(mut self, flag_name: String) -> None: + """Marks the given persistent flag with annotations so that `Prism` errors if the command is invoked without the flag. Args: @@ -604,13 +667,17 @@ struct Command(CollectionElement): abort(e) fn has_parent(self) -> Bool: - """Returns True if the command has a parent, False otherwise.""" + """Returns True if the command has a parent, False otherwise. + + Returns: + True if the command has a parent, False otherwise. + """ return self.parent.__bool__() fn visit_parents[func: ParentVisitorFn](self) -> None: """Visits all parents of the command and invokes func on each parent. - Params: + Parameters: func: The function to invoke on each parent. """ if self.has_parent(): diff --git a/src/prism/context.mojo b/src/prism/context.mojo index 9398374..4477b5b 100644 --- a/src/prism/context.mojo +++ b/src/prism/context.mojo @@ -1,11 +1,20 @@ -from memory import Arc +from memory import ArcPointer from .command import Command struct Context: - var command: Arc[Command] + """The context of the command being executed, a pointer to the command and the args to use.""" + var command: ArcPointer[Command] + """The command being executed.""" var args: List[String] + """The arguments passed to the command.""" - def __init__(inout self, command: Arc[Command], args: List[String]) -> None: + def __init__(mut self, command: ArcPointer[Command], args: List[String]) -> None: + """Initializes a new Context. + + Args: + command: The command being executed. + args: The arguments passed to the command. + """ self.command = command self.args = args diff --git a/src/prism/flag.mojo b/src/prism/flag.mojo index 4fbbe36..a5f973e 100644 --- a/src/prism/flag.mojo +++ b/src/prism/flag.mojo @@ -6,7 +6,7 @@ alias FlagActionFn = fn (ctx: Context, value: String) raises -> None # TODO: When we have trait objects, switch to using actual flag structs per type instead of # needing to cast values to and from string. @value -struct Flag(RepresentableCollectionElement, Stringable, Formattable): +struct Flag(RepresentableCollectionElement, Stringable, Writable): """Represents a flag that can be passed via the command line. Flags are passed in via --name or -shorthand and can have a value associated with them. """ @@ -35,7 +35,7 @@ struct Flag(RepresentableCollectionElement, Stringable, Formattable): """Whether the flag has been changed from its default value.""" fn __init__( - inout self, + mut self, name: String, type: String, shorthand: String = "", @@ -72,15 +72,30 @@ struct Flag(RepresentableCollectionElement, Stringable, Formattable): self.changed = False fn __str__(self) -> String: - output = String() - writer = output._unsafe_to_formatter() - self.format_to(writer) - return output + """Returns a string representation of the Flag. + + Returns: + The string representation of the Flag. + """ + return String.write(self) fn __repr__(self) -> String: + """Returns a string representation of the Flag. + + Returns: + The string representation of the Flag. + """ return self.__str__() fn __eq__(self, other: Self) -> Bool: + """Compares two Flags for equality. + + Args: + other: The other Flag to compare against. + + Returns: + True if the Flags are equal, False otherwise. + """ return ( self.name == other.name and self.shorthand == other.shorthand @@ -92,10 +107,21 @@ struct Flag(RepresentableCollectionElement, Stringable, Formattable): ) fn __ne__(self, other: Self) -> Bool: + """Compares two Flags for inequality. + + Args: + other: The other Flag to compare against. + + Returns: + True if the Flags are not equal, False otherwise. + """ return not self == other - fn format_to(self, inout writer: Formatter): - """Write Flag string representation to a `Formatter`. + fn write_to[W: Writer, //](self, mut writer: W): + """Write Flag string representation to a writer. + + Parameters: + W: The type of writer to write to. Args: writer: The formatter to write to. @@ -108,27 +134,27 @@ struct Flag(RepresentableCollectionElement, Stringable, Formattable): else: writer.write(repr(None)) - writer.write("Flag(Name: ") + writer.write("Flag(name=") writer.write(self.name) if self.shorthand != "": - writer.write(", Shorthand: ") + writer.write(", shorthand=") writer.write(self.shorthand) - writer.write(", Usage: ") + writer.write(", Usage=") writer.write(self.usage) if self.value: - writer.write(", Value: ") + writer.write(", value=") write_optional(self.value) - writer.write(", Default: ") + writer.write(", default=") writer.write(self.default) - writer.write(", Type: ") + writer.write(", type=") writer.write(self.type) - writer.write(", Changed: ") + writer.write(", changed=") writer.write(self.changed) writer.write(")") - fn set(inout self, value: String) -> None: + fn set(mut self, value: String) -> None: """Sets the value of the flag. Args: @@ -140,7 +166,8 @@ struct Flag(RepresentableCollectionElement, Stringable, Formattable): fn get_with_transform[T: CollectionElement, //, transform: fn (value: String) -> T](self) -> T: """Returns the value of the flag with a transformation applied to it. - Params: + Parameters: + T: The type of the value to return. transform: The transformation to apply to the value. Returns: diff --git a/src/prism/flag_group.mojo b/src/prism/flag_group.mojo index 8cdbd80..9bfcc02 100644 --- a/src/prism/flag_group.mojo +++ b/src/prism/flag_group.mojo @@ -2,10 +2,18 @@ from collections import Dict from os import abort from .flag import Flag from .flag_set import REQUIRED, REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE -from gojo import fmt fn has_all_flags(flags: FlagSet, flag_names: List[String]) -> Bool: + """Checks if all flags are defined in the FlagSet. + + Args: + flags: The FlagSet to check for the flags. + flag_names: The names of the flags to check for. + + Returns: + True if all flags are defined, False otherwise. + """ for name in flag_names: try: _ = flags.lookup(name[]) @@ -18,21 +26,32 @@ fn process_flag_for_group_annotation( flags: FlagSet, flag: Flag, annotation: String, - inout group_status: Dict[String, Dict[String, Bool]], + mut group_status: Dict[String, Dict[String, Bool]], ) raises -> None: - group_info = flag.annotations.get(annotation, List[String]()) + """Processes a flag for a group annotation. + + Args: + flags: The FlagSet to check for the flags. + flag: The flag to process. + annotation: The annotation to check for. + group_status: The status of the flag groups. + + Raises: + Error: If an error occurred while processing the flag. + """ + var group_info = flag.annotations.get(annotation, List[String]()) if group_info: for group in group_info: - group_name = group[] + var group_name = group[] if len(group_status.get(group_name, Dict[String, Bool]())) == 0: - flag_names = group_name.split(sep=" ") + var flag_names = group_name.split(sep=" ") # Only consider this flag group at all if all the flags are defined. if not has_all_flags(flags, flag_names): continue for name in flag_names: - entry = Dict[String, Bool]() + var entry = Dict[String, Bool]() entry[name[]] = False group_status[group[]] = entry @@ -41,23 +60,26 @@ fn process_flag_for_group_annotation( group_status[group[]][flag.name] = flag.changed except e: raise Error( - String( - "process_flag_for_group_annotation: Failed to set group status for annotation {}: {}." - ).format(annotation, str(e)) + "process_flag_for_group_annotation: Failed to set group status for annotation {}: {}.".format( + annotation, str(e) + ) ) -fn validate_required_flag_group(data: Dict[String, Dict[String, Bool]]) -> None: +fn validate_required_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: """Validates that all flags in a group are set if any are set. This is for flags that are marked as required via `Command().mark_flags_required_together()`. Args: data: The dictionary of flag groups to validate. + + Raises: + Error: If an error occurred while validating the flag groups. """ # Within each group, is a Dict of flag name and if they're set. # If it's unset then add to a list to check the condition of all required flags being set. for pair in data.items(): - unset = List[String]() + var unset = List[String]() for flag in pair[].value.items(): if not flag[].value: unset.append(flag[].key) @@ -67,29 +89,31 @@ fn validate_required_flag_group(data: Dict[String, Dict[String, Bool]]) -> None: # Sort values, so they can be tested/scripted against consistently. # unset.sort() - keys = List[String]() + var keys = List[String]() for key in pair[].value.keys(): keys.append(key[]) abort( - fmt.sprintf( - "If any flags in the group, %s, are set they must all be set; missing %s.", + "If any flags in the group, {}, are set they must all be set; missing {}.".format( keys.__str__(), unset.__str__(), ) ) -fn validate_one_required_flag_group(data: Dict[String, Dict[String, Bool]]) -> None: +fn validate_one_required_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: """Validates that at least one flag in a group is set. This is for flags that are marked as required via `Command().mark_flag_required()`. Args: data: The dictionary of flag groups to validate. + + Raises: + Error: If an error occurred while validating the flag groups. """ # Check if at least one key is set. for pair in data.items(): - set = List[String]() + var set = List[String]() for flag in pair[].value.items(): if flag[].value: set.append(flag[].key) @@ -99,23 +123,26 @@ fn validate_one_required_flag_group(data: Dict[String, Dict[String, Bool]]) -> N # Sort values, so they can be tested/scripted against consistently. # unset.sort() - keys = List[String]() + var keys = List[String]() for key in pair[].value.keys(): keys.append(key[]) - abort(fmt.sprintf("At least one of the flags in the group %s is required.", keys.__str__())) + abort("At least one of the flags in the group {} is required.".format(keys.__str__())) -fn validate_mutually_exclusive_flag_group(data: Dict[String, Dict[String, Bool]]) -> None: +fn validate_mutually_exclusive_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: """Validates that only one flag in a group is set. This is for flags that are marked as required via `Command().mark_flags_mutually_exclusive()`. Args: data: The dictionary of flag groups to validate. + + Raises: + Error: If an error occurred while validating the flag groups. """ # Check if more than one mutually exclusive flag is set. for pair in data.items(): - set = List[String]() + var set = List[String]() for flag in pair[].value.items(): if flag[].value: set.append(flag[].key) @@ -125,13 +152,12 @@ fn validate_mutually_exclusive_flag_group(data: Dict[String, Dict[String, Bool]] # Sort values, so they can be tested/scripted against consistently. # unset.sort() - keys = List[String]() + var keys = List[String]() for key in pair[].value.keys(): keys.append(key[]) abort( - fmt.sprintf( - "If any flags in the group %s are set none of the others can be; %s were all set.", + "If any flags in the group {} are set none of the others can be; {} were all set.".format( keys.__str__(), set.__str__(), ) @@ -142,7 +168,7 @@ fn validate_flag_groups( group_status: Dict[String, Dict[String, Bool]], one_required_group_status: Dict[String, Dict[String, Bool]], mutually_exclusive_group_status: Dict[String, Dict[String, Bool]], -) -> None: +) raises -> None: """Validates the status of flag groups. Checks for flag groups that are required together, at least one required, and mutually exclusive. Status is a map of maps containing the flag name and if it's been set. @@ -151,6 +177,9 @@ fn validate_flag_groups( group_status: The status of flag groups that are required together. one_required_group_status: The status of flag groups that require at least one flag to be set. mutually_exclusive_group_status: The status of flag groups that are mutually exclusive. + + Raises: + Error: If an error occurred while validating the flag groups. """ validate_required_flag_group(group_status) validate_one_required_flag_group(one_required_group_status) @@ -158,9 +187,17 @@ fn validate_flag_groups( fn validate_flag_groups(flags: FlagSet) raises -> None: - group_status = Dict[String, Dict[String, Bool]]() - one_required_group_status = Dict[String, Dict[String, Bool]]() - mutually_exclusive_group_status = Dict[String, Dict[String, Bool]]() + """Validates the status of flag groups. + + Args: + flags: The flags to validate. + + Raises: + Error: If an error occurred while validating the flag groups. + """ + var group_status = Dict[String, Dict[String, Bool]]() + var one_required_group_status = Dict[String, Dict[String, Bool]]() + var mutually_exclusive_group_status = Dict[String, Dict[String, Bool]]() @parameter fn flag_checker(flag: Flag) raises -> None: diff --git a/src/prism/flag_parser.mojo b/src/prism/flag_parser.mojo index cb22fb6..fbedce6 100644 --- a/src/prism/flag_parser.mojo +++ b/src/prism/flag_parser.mojo @@ -1,6 +1,6 @@ -from utils import Span -from collections import InlineArray import os +from memory import Span +from collections import InlineArray from .flag_set import FlagSet from .util import split @@ -11,7 +11,8 @@ struct FlagParser: var index: Int """The current index in the arguments list.""" - fn __init__(inout self) -> None: + fn __init__(mut self) -> None: + """Initializes the FlagParser.""" self.index = 0 fn parse_flag(self, argument: String, arguments: Span[String], flags: FlagSet) raises -> Tuple[String, String, Int]: @@ -21,12 +22,18 @@ struct FlagParser: argument: The argument to parse. arguments: The list of arguments passed via the command line. flags: The flags passed via the command line. + + Returns: + The name, value, the index to increment by, and an error if one occurred. + + Raises: + Error: If an error occurred while parsing the flag. """ # Flag with value set like "--flag=" if argument.find("=") != -1: - flag = split(argument, "=") - name = flag[0][2:] - value = flag[1] + var flag = split(argument, "=") + var name = flag[0][2:] + var value = flag[1] if name not in flags.names(): raise Error("Command does not accept the flag supplied: " + name) @@ -34,7 +41,7 @@ struct FlagParser: return name, value, 1 # Flag with value set like "--flag " - name = argument[2:] + var name = argument[2:] if name not in flags.names(): raise Error("Command does not accept the flag supplied: " + name) @@ -66,21 +73,24 @@ struct FlagParser: Returns: The name, value, the index to increment by, and an error if one occurred. + + Raises: + Error: If an error occurred while parsing the shorthand flag. """ # Flag with value set like "-f=" if argument.find("=") != -1: - flag = split(argument, "=") - shorthand = flag[0][1:] - value = flag[1] - name = flags.lookup_name(shorthand) + var flag = split(argument, "=") + var shorthand = flag[0][1:] + var value = flag[1] + var name = flags.lookup_name(shorthand) if name not in flags.names(): raise Error("Command does not accept the shorthand flag supplied: " + name) return name, value, 1 # Flag with value set like "-f " - shorthand = argument[1:] - name = flags.lookup_name(shorthand) + var shorthand = argument[1:] + var name = flags.lookup_name(shorthand) if name not in flags.names(): raise Error("Command does not accept the shorthand flag supplied: " + shorthand) @@ -101,16 +111,22 @@ struct FlagParser: return name, arguments[self.index + 1], 2 # TODO: This parsing is dirty atm, will come back around and clean it up. - fn parse(inout self, inout flags: FlagSet, arguments: List[String]) raises -> List[String]: + fn parse(mut self, mut flags: FlagSet, arguments: List[String]) raises -> List[String]: """Parses flags and args from the args passed via the command line and adds them to their appropriate collections. Args: flags: The flags to parse. arguments: The arguments passed via the command line. + + Returns: + The arguments that are not flags. + + Raises: + Error: If an error occurred while parsing the flags. """ - remaining_args = List[String](capacity=len(arguments)) + var remaining_args = List[String](capacity=len(arguments)) while self.index < len(arguments): - argument = arguments[self.index] + var argument = arguments[self.index] # Positional argument if not argument.startswith("-", 0, 1): @@ -120,7 +136,7 @@ struct FlagParser: var name: String var value: String - increment_by = 0 + var increment_by = 0 # Full flag if argument.startswith("--", 0, 2): @@ -133,14 +149,12 @@ struct FlagParser: # Set the value of the flag. alias list_types = InlineArray[String, 3]("StringList", "IntList", "Float64List") - flag = flags.lookup(name) + var flag = flags.lookup(name) if flag[].type in list_types: if not flag[].changed: flag[].set(value) else: - # TODO: Switch to write to the string in the next update. - writer = flag[].value.value()._unsafe_to_formatter() - writer.write(" ", value) + flag[].value.value().write(", ", value) else: flag[].set(value) self.index += increment_by diff --git a/src/prism/flag_set.mojo b/src/prism/flag_set.mojo index 680df9a..9e566ac 100644 --- a/src/prism/flag_set.mojo +++ b/src/prism/flag_set.mojo @@ -1,7 +1,6 @@ from collections import Optional, Dict, InlineList from utils import Variant -from memory import Reference -import gojo.fmt +from memory import Pointer from .flag import Flag, FlagActionFn from .util import string_to_bool, split from .flag_parser import FlagParser @@ -23,54 +22,119 @@ alias MUTUALLY_EXCLUSIVE = "MUTUALLY_EXCLUSIVE" @value struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparable): + """Represents a set of flags.""" var flags: List[Flag] + """The list of flags in the flag set.""" - fn __init__(inout self) -> None: + fn __init__(mut self) -> None: + """Initializes a new FlagSet.""" self.flags = List[Flag]() - fn __init__(inout self, other: FlagSet) -> None: + fn __init__(mut self, other: FlagSet) -> None: + """Initializes a new FlagSet from another FlagSet. + + Args: + other: The other FlagSet to copy from. + """ self.flags = other.flags fn __str__(self) -> String: - output = String() - writer = output._unsafe_to_formatter() - self.format_to(writer) - return output + """Returns a string representation of the FlagSet. - fn format_to(self, inout writer: Formatter): - writer.write("Flags: [") + Returns: + The string representation of the FlagSet. + """ + return String.write(self) + + fn write_to[W: Writer, //](self, mut writer: W): + """Write a string representation to a writer. + + Parameters: + W: The type of writer to write to. + + Args: + writer: The writer to write to. + """ + writer.write("FlagSet: [") for i in range(self.flags.size): - self.flags[i].format_to(writer) + writer.write(self.flags[i]) if i != self.flags.size - 1: writer.write(", ") writer.write("]") fn __len__(self) -> Int: + """Returns the number of flags in the flag set. + + Returns: + The number of flags in the flag set. + """ return self.flags.size fn __bool__(self) -> Bool: + """Returns whether the flag set is empty. + + Returns: + Whether the flag set is empty. + """ return self.flags.__bool__() fn __contains__(self, value: Flag) -> Bool: + """Returns whether the flag set contains a flag. + + Args: + value: The flag to check for. + + Returns: + Whether the flag set contains the flag. + """ return value in self.flags fn __eq__(self, other: Self) -> Bool: + """Compares two FlagSets for equality. + + Args: + other: The other FlagSet to compare against. + + Returns: + True if the FlagSets are equal, False otherwise. + """ return self.flags == other.flags fn __ne__(self, other: Self) -> Bool: + """Compares two FlagSets for inequality. + + Args: + other: The other FlagSet to compare against. + + Returns: + True if the FlagSets are not equal, False otherwise. + """ return self.flags != other.flags - fn __add__(inout self, other: Self) -> Self: + fn __add__(mut self, other: Self) -> Self: + """Merges two FlagSets together. + + Args: + other: The other FlagSet to merge with. + + Returns: + A new FlagSet with the merged flags. + """ new = Self(self) for flag in other.flags: new.flags.append(flag[]) return new - fn __iadd__(inout self, other: Self): + fn __iadd__(mut self, other: Self): + """Merges another FlagSet into this FlagSet. + + Args: + other: The other FlagSet to merge with. + """ self.merge(other) - fn lookup(ref [_]self, name: String, type: String = "") raises -> Reference[Flag, __lifetime_of(self.flags)]: - """Returns an mutable or immutable reference to a Flag with the given name. + fn lookup(ref self, name: String, type: String = "") raises -> Pointer[Flag, __origin_of(self.flags)]: + """Returns an mutable or immutable Pointer to a Flag with the given name. Mutable if FlagSet is mutable, immutable if FlagSet is immutable. Args: @@ -78,16 +142,19 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl type: The type of the Flag to lookup. Returns: - Optional Reference to the Flag. + Optional Pointer to the Flag. + + Raises: + Error: If the Flag is not found. """ if type == "": for i in range(len(self.flags)): if self.flags[i].name == name: - return self.flags[i] + return Pointer.address_of(self.flags[i]) else: for i in range(len(self.flags)): if self.flags[i].name == name and self.flags[i].type == type: - return self.flags[i] + return Pointer.address_of(self.flags[i]) raise Error("FlagNotFoundError: Could not find the following flag: " + name) @@ -96,6 +163,12 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl Args: shorthand: The shorthand of the flag to lookup. + + Returns: + The name of the flag. + + Raises: + Error: If the flag is not found. """ for flag in self.flags: if flag[].shorthand and flag[].shorthand == shorthand: @@ -104,107 +177,312 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl raise Error("FlagNotFoundError: Could not find the following flag shorthand: " + shorthand) fn get_as[ - R: CollectionElement, transform: fn (flag_set: FlagSet, name: String) raises -> R + R: CollectionElement, //, transform: fn (flag_set: FlagSet, name: String) raises -> R ](self, name: String) raises -> R: + """Returns the value of a flag as a specific type. + + Parameters: + R: The type to return the flag as. + transform: The transformation to apply to the flag value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as the specified type. + + Raises: + Error: If the flag is not found. + """ return transform(self, name) fn get_string(self, name: String) raises -> String: - """Returns the value of a flag as a String. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `String`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `String`. + + Raises: + Error: If the flag is not found. + """ return self.lookup(name, "String")[].value_or_default() fn get_bool(self, name: String) raises -> Bool: - """Returns the value of a flag as a Bool. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `Bool`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Bool`. + + Raises: + Error: If the flag is not found. + """ return string_to_bool(self.lookup(name, "Bool")[].value_or_default()) fn get_int(self, name: String, type: String = "Int") raises -> Int: - """Returns the value of a flag as an Int. If it isn't set, then return the default value.""" + """Returns the value of a flag as an `Int`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + type: The type of the flag. + + Returns: + The value of the flag as an `Int`. + + Raises: + Error: If the flag is not found. + """ return atol(self.lookup(name, type)[].value_or_default()) fn get_int8(self, name: String) raises -> Int8: - """Returns the value of a flag as a Int8. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `Int8`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Int8`. + + Raises: + Error: If the flag is not found. + """ return Int8(self.get_int(name, "Int8")) fn get_int16(self, name: String) raises -> Int16: - """Returns the value of a flag as a Int16. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `Int16`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Int16`. + + Raises: + Error: If the flag is not found. + """ return Int16(self.get_int(name, "Int16")) fn get_int32(self, name: String) raises -> Int32: - """Returns the value of a flag as a Int32. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `Int32`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Int32`. + + Raises: + Error: If the flag is not found. + """ return Int32(self.get_int(name, "Int32")) fn get_int64(self, name: String) raises -> Int64: - """Returns the value of a flag as a Int64. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `Int64`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Int64`. + + Raises: + Error: If the flag is not found. + """ return Int64(self.get_int(name, "Int64")) fn get_uint8(self, name: String) raises -> UInt8: - """Returns the value of a flag as a UInt8. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `UInt8`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt8`. + + Raises: + Error: If the flag is not found. + """ return UInt8(self.get_int(name, "UInt8")) fn get_uint16(self, name: String) raises -> UInt16: - """Returns the value of a flag as a UInt16. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `UInt16`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt16`. + + Raises: + Error: If the flag is not found. + """ return UInt16(self.get_int(name, "UInt16")) fn get_uint32(self, name: String) raises -> UInt32: - """Returns the value of a flag as a UInt32. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `UInt32`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt32`. + + Raises: + Error: If the flag is not found. + """ return UInt32(self.get_int(name, "UInt32")) fn get_uint64(self, name: String) raises -> UInt64: - """Returns the value of a flag as a UInt64. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `UInt64`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt64`. + + Raises: + Error: If the flag is not found. + """ return UInt64(self.get_int(name, "UInt64")) fn get_float16(self, name: String) raises -> Float16: - """Returns the value of a flag as a Float64. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `Float16`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Float16`. + + Raises: + Error: If the flag is not found. + """ return self.get_float64(name).cast[DType.float16]() fn get_float32(self, name: String) raises -> Float32: - """Returns the value of a flag as a Float64. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `Float32`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Float32`. + + Raises: + Error: If the flag is not found. + """ return self.get_float64(name).cast[DType.float32]() fn get_float64(self, name: String) raises -> Float64: - """Returns the value of a flag as a Float64. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `Float64`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Float64`. + + Raises: + Error: If the flag is not found. + """ return atof(self.lookup(name, "Float64")[].value_or_default()) fn _get_list(self, name: String, type: String) raises -> List[String]: - """Returns the value of a flag as a List[String]. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + type: The type of the flag. + + Returns: + The value of the flag as a `List[String]`. + + Raises: + Error: If the flag is not found. + """ return self.lookup(name, type)[].value_or_default().split(sep=" ") fn get_string_list(self, name: String) raises -> List[String]: - """Returns the value of a flag as a List[String]. If it isn't set, then return the default value.""" + """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `List[String]`. + + Raises: + Error: If the flag is not found. + """ return self._get_list(name, "StringList") fn get_int_list(self, name: String) raises -> List[Int]: - """Returns the value of a flag as a List[Int]. If it isn't set, then return the default value.""" - values = self._get_list(name, "IntList") - ints = List[Int](capacity=len(values)) + """Returns the value of a flag as a `List[Int]`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `List[Int]`. + + Raises: + Error: If the flag is not found. + """ + var values = self._get_list(name, "IntList") + var ints = List[Int](capacity=len(values)) for value in values: ints.append(atol(value[])) return ints fn get_float64_list(self, name: String) raises -> List[Float64]: - """Returns the value of a flag as a List[Float64]. If it isn't set, then return the default value.""" - values = self._get_list(name, "Float64List") - floats = List[Float64](capacity=len(values)) + """Returns the value of a flag as a `List[Float64]`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `List[Float64]`. + + Raises: + Error: If the flag is not found. + """ + var values = self._get_list(name, "Float64List") + var floats = List[Float64](capacity=len(values)) for value in values: floats.append(atof(value[])) return floats fn names(self) -> List[String]: - """Returns a list of names of all flags in the flag set.""" - result = List[String](capacity=len(self.flags)) + """Returns a list of names of all flags in the flag set. + + Returns: + A list of names of all flags in the flag set. + """ + var result = List[String](capacity=len(self.flags)) for flag in self.flags: result.append(flag[].name) return result fn shorthands(self) -> List[String]: - """Returns a list of shorthands of all flags in the flag set.""" - result = List[String](capacity=len(self.flags)) + """Returns a list of shorthands of all flags in the flag set. + + Returns: + A list of shorthands of all flags in the flag set. + """ + var result = List[String](capacity=len(self.flags)) for flag in self.flags: if flag[].shorthand: result.append(flag[].shorthand) return result fn bool_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -213,7 +491,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `Bool` flag to the flag set.""" + """Adds a `Bool` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -228,7 +516,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn string_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -237,7 +525,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `String` flag to the flag set.""" + """Adds a `String` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -252,7 +550,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn int_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -261,7 +559,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds an `Int` flag to the flag set.""" + """Adds an `Int` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -276,7 +584,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn int8_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -285,7 +593,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds an `Int8` flag to the flag set.""" + """Adds an `Int8` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -300,7 +618,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn int16_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -309,7 +627,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds an `Int16` flag to the flag set.""" + """Adds an `Int16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -324,7 +652,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn int32_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -333,7 +661,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds an `Int32` flag to the flag set.""" + """Adds an `Int32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -348,7 +686,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn int64_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -357,7 +695,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds an `Int64` flag to the flag set.""" + """Adds an `Int64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -372,7 +720,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn uint8_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -381,7 +729,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `UInt8` flag to the flag set.""" + """Adds a `UInt8` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -396,7 +754,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn uint16_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -405,7 +763,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `UInt16` flag to the flag set.""" + """Adds a `UInt16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -420,7 +788,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn uint32_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -429,7 +797,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `UInt32` flag to the flag set.""" + """Adds a `UInt32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -444,7 +822,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn uint64_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -453,7 +831,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `UInt64` flag to the flag set.""" + """Adds a `UInt64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -468,7 +856,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn float16_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -477,7 +865,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `Float16` flag to the flag set.""" + """Adds a `Float16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -492,7 +890,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn float32_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -501,7 +899,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `Float32` flag to the flag set.""" + """Adds a `Float32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -516,7 +924,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn float64_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -525,7 +933,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `Float64` flag to the flag set.""" + """Adds a `Float64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -540,7 +958,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn string_list_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -549,7 +967,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `StringList` flag to the flag set.""" + """Adds a `StringList` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -564,7 +992,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn int_list_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -573,7 +1001,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `IntList` flag to the flag set.""" + """Adds a `IntList` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -588,7 +1026,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) fn float64_list_flag( - inout self, + mut self, name: String, usage: String, shorthand: String = "", @@ -597,7 +1035,17 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, ) -> None: - """Adds a `Float64List` flag to the flag set.""" + """Adds a `Float64List` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ self.flags.append( Flag( name=name, @@ -611,37 +1059,55 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl ) ) - fn set_annotation(inout self, name: String, key: String, values: String) raises -> None: + fn set_annotation(mut self, name: String, key: String, values: String) raises -> None: """Sets an annotation for a flag. Args: name: The name of the flag to set the annotation for. key: The key of the annotation. values: The values of the annotation. + + Raises: + Error: If setting the value for the annotation fails. """ # Annotation value can be a concatenated string of values. # Why? Because we can have multiple required groups of flags for example. # So each value of the list for the annotation can be a group of flag names. try: - # TODO: remove running 2 lookups when ref can return a reference + # TODO: remove running 2 lookups when ref can return a Pointer # we can store as a without copying the result. self.lookup(name)[].annotations[key].extend(values) except: self.lookup(name)[].annotations[key] = List[String](values) - fn set_required(inout self, name: String) raises -> None: + fn set_required(mut self, name: String) raises -> None: """Sets a flag as required or not. Args: name: The name of the flag to set as required. + + Raises: + Error: If setting the value for the annotation fails. """ try: self.set_annotation(name, REQUIRED, "true") except e: - print(String("FlagSet.set_required: Failed to set flag, {}, to required.").format(name), file=2) + print("FlagSet.set_required: Failed to set flag, {}, to required.".format(name), file=2) raise e - fn set_as[annotation_type: String](inout self, name: String, names: String) raises -> None: + fn set_as[annotation_type: String](mut self, name: String, names: String) raises -> None: + """Sets a flag as a specific annotation type. + + Parameters: + annotation_type: The type of annotation to set. + + Args: + name: The name of the flag to set the annotation for. + names: The values of the annotation. + + Raises: + Error: If the annotation type is not one of `REQUIRED_AS_GROUP`, `ONE_REQUIRED`, or `MUTUALLY_EXCLUSIVE`. + """ constrained[ annotation_type not in [REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE], "annotation_type must be one of REQUIRED_AS_GROUP, ONE_REQUIRED, or MUTUALLY_EXCLUSIVE.", @@ -650,7 +1116,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl self.set_annotation(name, annotation_type, names) except e: print( - String("FlagSet.set_as: Failed to set flag, {}, with the following annotation: {}").format( + "FlagSet.set_as: Failed to set flag, {}, with the following annotation: {}".format( name, annotation_type ), file=2, @@ -660,7 +1126,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl fn visit_all[visitor: FlagVisitorFn](self) -> None: """Visits all flags in the flag set. - Params: + Parameters: visitor: The visitor function to call for each flag. """ for flag in self.flags: @@ -669,19 +1135,21 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl fn visit_all[visitor: FlagVisitorRaisingFn](self) raises -> None: """Visits all flags in the flag set. - Params: + Parameters: visitor: The visitor function to call for each flag. + + Raises: + Error: If the visitor raises an error. """ for flag in self.flags: visitor(flag[]) - fn merge(inout self, new_set: Self) -> None: + fn merge(mut self, new_set: Self) -> None: """Adds flags from another FlagSet. If a flag is already present, the flag from the new set is ignored. Args: new_set: The flag set to add. """ - @always_inline fn add_flag(flag: Flag) capturing -> None: try: @@ -692,7 +1160,7 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl new_set.visit_all[add_flag]() - fn from_args(inout self, arguments: List[String]) raises -> List[String]: + fn from_args(mut self, arguments: List[String]) raises -> List[String]: """Parses flags and args from the args passed via the command line and adds them to their appropriate collections. Args: @@ -700,18 +1168,28 @@ struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparabl Returns: The remaining arguments after parsing out flags. + + Raises: + Error: If a flag is not recognized. """ - parser = FlagParser() + var parser = FlagParser() return parser.parse(self, arguments) fn validate_required_flags(flags: FlagSet) raises -> None: - """Validates all required flags are present and returns an error otherwise.""" - missing_flag_names = List[String]() + """Validates all required flags are present and returns an error otherwise. + + Args: + flags: The flags to validate. + + Raises: + Error: If a required flag is not set. + """ + var missing_flag_names = List[String]() @parameter fn check_required_flag(flag: Flag) -> None: - required_annotation = flag.annotations.get(REQUIRED, List[String]()) + var required_annotation = flag.annotations.get(REQUIRED, List[String]()) if required_annotation: if required_annotation[0] == "true" and not flag.changed: missing_flag_names.append(flag.name) diff --git a/src/prism/util.mojo b/src/prism/util.mojo index b1123d5..56200fc 100644 --- a/src/prism/util.mojo +++ b/src/prism/util.mojo @@ -1,8 +1,18 @@ from collections import InlineList -from memory import Arc +from memory import ArcPointer fn split(text: String, sep: String, max_split: Int = -1) -> List[String]: + """Splits a string into a list of substrings. + + Args: + text: The string to split. + sep: The separator to split the string by. + max_split: The maximum number of splits to perform. + + Returns: + The list of substrings. + """ try: return text.split(sep, max_split) except: @@ -25,20 +35,38 @@ fn string_to_bool(value: String) -> Bool: return False -fn to_string[T: StringableCollectionElement](vector: List[Arc[T]]) -> String: - result = String("[") +fn to_string[T: StringableCollectionElement](vector: List[ArcPointer[T]]) -> String: + """Converts a vector to a string. + + Parameters: + T: The type of the vector elements. + + Args: + vector: The vector to convert to a string. + + Returns: + The string representation of the vector. + """ + var result = String("[") for i in range(vector.size): flag = vector[i] - result += str(flag[]) + result.write(str(flag[])) if i < vector.size - 1: - result += String(", ") - result += String("]") + result.write(", ") + result.write("]") return result fn to_list(flag_names: VariadicListMem[String, _]) -> List[String]: - result = List[String](capacity=len(flag_names)) + """Converts a variadic list to a list. + + Args: + flag_names: The variadic list to convert to a list. + + Returns: + The list representation of the variadic list. + """ + var result = List[String](capacity=len(flag_names)) for name in flag_names: result.append(name[]) - return result diff --git a/src/recipe.tmpl b/src/recipe.tmpl index b039243..7fc8843 100644 --- a/src/recipe.tmpl +++ b/src/recipe.tmpl @@ -14,7 +14,7 @@ source: build: script: - mkdir -p ${PREFIX}/lib/mojo - - magic run mojo package {{NAME}} -o ${PREFIX}/lib/mojo/{{NAME}}.mojopkg + - magic run {{ENVIRONMENT_FLAG}} mojo package {{NAME}} -o ${PREFIX}/lib/mojo/{{NAME}}.mojopkg requirements: run: diff --git a/test/test_args.mojo b/test/test_args.mojo index 4c5449b..bca3003 100644 --- a/test/test_args.mojo +++ b/test/test_args.mojo @@ -1,4 +1,4 @@ -from memory.arc import Arc +from memory import ArcPointer import testing from prism import Command, Context from prism.args import ( @@ -9,7 +9,7 @@ from prism.args import ( maximum_n_args, exact_args, range_args, - match_all, + # match_all, ArgValidatorFn, ) diff --git a/test/test_command.mojo b/test/test_command.mojo index 422953e..d9f8a15 100644 --- a/test/test_command.mojo +++ b/test/test_command.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer import testing from prism.command import Command, Context from prism.flag_set import FlagSet @@ -8,14 +8,12 @@ def test_command_operations(): fn dummy(ctx: Context) -> None: return None - cmd = Arc(Command(name="root", usage="Base command.", run=dummy)) + cmd = Command(name="root", usage="Base command.", run=dummy) + for flag in cmd.flags.flags: + testing.assert_equal("help", flag[].name) - flags = cmd[].flags.flags - for flag in flags: - testing.assert_equal(String("help"), flag[].name) - - child_cmd = Arc(Command(name="child", usage="Child command.", run=dummy)) - cmd[].add_subcommand(child_cmd) + child_cmd = ArcPointer(Command(name="child", usage="Child command.", run=dummy)) + cmd.add_subcommand(child_cmd) child_cmd[].flags.string_flag(name="color", shorthand="c", usage="Text color", default="#3464eb") testing.assert_equal(child_cmd[].full_name(), "root child") diff --git a/test/test_flags.mojo b/test/test_flags.mojo index b9ac9af..1988056 100644 --- a/test/test_flags.mojo +++ b/test/test_flags.mojo @@ -1,4 +1,4 @@ -from memory.arc import Arc +from memory import ArcPointer import testing from prism.flag import Flag from prism.flag_set import FlagSet, string_to_bool From 4a72b39a1f5c24b85369ec5f1f010dfd3ca1f0ae Mon Sep 17 00:00:00 2001 From: Mikhail Tavarez Date: Mon, 23 Dec 2024 11:16:14 -0600 Subject: [PATCH 2/7] trying new flags approach --- README.md | 2 +- examples/aliases.mojo | 2 +- examples/alt_flag_values.mojo | 2 +- examples/arg_validators.mojo | 2 +- examples/chromeria.mojo | 9 ++++--- examples/fg_child.mojo | 2 +- examples/fg_parent.mojo | 2 +- examples/flag_action.mojo | 2 +- examples/hello_world.mojo | 18 +++++++------- examples/list_flags.mojo | 2 +- examples/printer/printer.mojo | 2 +- examples/requests/nested.mojo | 2 +- examples/requests/persistent_flags.mojo | 2 +- src/prism/args.mojo | 2 +- src/prism/command.mojo | 8 ++++--- src/prism/context.mojo | 2 +- src/prism/flag.mojo | 1 + src/prism/flag_set.mojo | 31 +++++++++++++++++++++++++ src/prism/util.mojo | 8 ++----- test/test_args.mojo | 2 +- test/test_command.mojo | 2 +- test/test_flags.mojo | 2 +- 22 files changed, 70 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 86afca8..28858ea 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ magic run mojo path/to/hello_world.mojo Here's an example of a basic command and subcommand! ```mojo -from memory import Arc +from memory import ArcPointer from prism import Command, Context diff --git a/examples/aliases.mojo b/examples/aliases.mojo index 1974cbd..b95d269 100644 --- a/examples/aliases.mojo +++ b/examples/aliases.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Context, Command diff --git a/examples/alt_flag_values.mojo b/examples/alt_flag_values.mojo index 6a5581a..b146c79 100644 --- a/examples/alt_flag_values.mojo +++ b/examples/alt_flag_values.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context diff --git a/examples/arg_validators.mojo b/examples/arg_validators.mojo index 07c37b4..1ba80fe 100644 --- a/examples/arg_validators.mojo +++ b/examples/arg_validators.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import ( Command, Context, diff --git a/examples/chromeria.mojo b/examples/chromeria.mojo index d95f3d4..e222620 100644 --- a/examples/chromeria.mojo +++ b/examples/chromeria.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointerPointer from prism import Command, Context @@ -15,9 +15,12 @@ fn main() -> None: name="hello", usage="This is a dummy command!", run=test, + children=List[ArcPointer[Command]]( + ArcPointer(Command(name="chromeria", usage="This is a dummy command!", run=hello)) + ), ) - var hello_command = Arc(Command(name="chromeria", usage="This is a dummy command!", run=hello)) + # var hello_command = ArcPointer(Command(name="chromeria", usage="This is a dummy command!", run=hello)) - root.add_subcommand(hello_command) + # root.add_subcommand(hello_command) root.execute() diff --git a/examples/fg_child.mojo b/examples/fg_child.mojo index 982e058..e0922e8 100644 --- a/examples/fg_child.mojo +++ b/examples/fg_child.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context diff --git a/examples/fg_parent.mojo b/examples/fg_parent.mojo index 373664d..e3ee995 100644 --- a/examples/fg_parent.mojo +++ b/examples/fg_parent.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context diff --git a/examples/flag_action.mojo b/examples/flag_action.mojo index a8132e3..7bf7188 100644 --- a/examples/flag_action.mojo +++ b/examples/flag_action.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context diff --git a/examples/hello_world.mojo b/examples/hello_world.mojo index cf46691..ec95a99 100644 --- a/examples/hello_world.mojo +++ b/examples/hello_world.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context @@ -11,8 +11,8 @@ fn printer(ctx: Context) -> None: return -fn build_printer_command() -> Arc[Command]: - var cmd = Arc( +fn build_printer_command() -> ArcPointer[Command]: + var cmd = ArcPointer( Command( name="printer", usage="Print the first arg.", @@ -38,8 +38,8 @@ fn say_goodbye(ctx: Context) -> None: # for some reason returning the command object without setting it to variable breaks the compiler -fn build_say_command() -> Arc[Command]: - return Arc( +fn build_say_command() -> ArcPointer[Command]: + return ArcPointer( Command( name="say", usage="Say something to someone", @@ -48,8 +48,8 @@ fn build_say_command() -> Arc[Command]: ) -fn build_hello_command() -> Arc[Command]: - var cmd = Arc( +fn build_hello_command() -> ArcPointer[Command]: + var cmd = ArcPointer( Command( name="hello", usage="Say hello to someone", @@ -59,8 +59,8 @@ fn build_hello_command() -> Arc[Command]: return cmd -fn build_goodbye_command() -> Arc[Command]: - var cmd = Arc( +fn build_goodbye_command() -> ArcPointer[Command]: + var cmd = ArcPointer( Command( name="goodbye", usage="Say goodbye to someone", diff --git a/examples/list_flags.mojo b/examples/list_flags.mojo index 28b1b02..467d9df 100644 --- a/examples/list_flags.mojo +++ b/examples/list_flags.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context diff --git a/examples/printer/printer.mojo b/examples/printer/printer.mojo index 2eb1931..e75f007 100644 --- a/examples/printer/printer.mojo +++ b/examples/printer/printer.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context, exact_args import mist diff --git a/examples/requests/nested.mojo b/examples/requests/nested.mojo index b255ada..608a22b 100644 --- a/examples/requests/nested.mojo +++ b/examples/requests/nested.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context from python import Python diff --git a/examples/requests/persistent_flags.mojo b/examples/requests/persistent_flags.mojo index 64da5d3..b1222a6 100644 --- a/examples/requests/persistent_flags.mojo +++ b/examples/requests/persistent_flags.mojo @@ -1,4 +1,4 @@ -from memory import Arc +from memory import ArcPointer from prism import Command, Context from python import Python diff --git a/src/prism/args.mojo b/src/prism/args.mojo index 790c31e..101474a 100644 --- a/src/prism/args.mojo +++ b/src/prism/args.mojo @@ -1,4 +1,4 @@ -from memory import ArcPointer +from memory import ArcPointerPointer from collections.optional import Optional from .command import ArgValidatorFn from .context import Context diff --git a/src/prism/command.mojo b/src/prism/command.mojo index 9fca6cc..be2a314 100644 --- a/src/prism/command.mojo +++ b/src/prism/command.mojo @@ -1,6 +1,6 @@ from sys import argv from collections import Optional, Dict, InlineList -from memory import ArcPointer +from memory import ArcPointerPointer from os import abort import mog from .util import to_string, to_list @@ -125,7 +125,7 @@ struct Command(CollectionElement, Writable, Stringable): """A struct representing a command that can be executed from the command line. ```mojo - from memory import ArcPointer + from memory import ArcPointerPointer from prism import Command, Context fn test(ctx: Context) -> None: @@ -209,6 +209,7 @@ struct Command(CollectionElement, Writable, Stringable): usage: String, aliases: List[String] = List[String](), valid_args: List[String] = List[String](), + children: List[ArcPointer[Self]] = List[ArcPointer[Self]](), run: Optional[CmdFn] = None, pre_run: Optional[CmdFn] = None, post_run: Optional[CmdFn] = None, @@ -227,6 +228,7 @@ struct Command(CollectionElement, Writable, Stringable): usage: The usage of the command. aliases: The aliases for the command. valid_args: The valid arguments for the command. + children: The child commands. run: The function to run when the command is executed. pre_run: The function to run before the command is executed. post_run: The function to run after the command is executed. @@ -263,7 +265,7 @@ struct Command(CollectionElement, Writable, Stringable): self.arg_validator = arbitrary_args self.valid_args = valid_args - self.children = List[ArcPointer[Self]]() + self.children = children self.parent = List[ArcPointer[Self]](capacity=1) # These need to be mutable so we can add flags to them. diff --git a/src/prism/context.mojo b/src/prism/context.mojo index 4477b5b..e557b93 100644 --- a/src/prism/context.mojo +++ b/src/prism/context.mojo @@ -1,4 +1,4 @@ -from memory import ArcPointer +from memory import ArcPointerPointer from .command import Command diff --git a/src/prism/flag.mojo b/src/prism/flag.mojo index a5f973e..7fba0fd 100644 --- a/src/prism/flag.mojo +++ b/src/prism/flag.mojo @@ -1,6 +1,7 @@ from collections import Optional, Dict alias FlagActionFn = fn (ctx: Context, value: String) raises -> None +"""The type of a function that runs after a flag has been processed.""" # TODO: When we have trait objects, switch to using actual flag structs per type instead of diff --git a/src/prism/flag_set.mojo b/src/prism/flag_set.mojo index 9e566ac..4fe5099 100644 --- a/src/prism/flag_set.mojo +++ b/src/prism/flag_set.mojo @@ -1198,3 +1198,34 @@ fn validate_required_flags(flags: FlagSet) raises -> None: if len(missing_flag_names) > 0: raise Error("Required flag(s): " + missing_flag_names.__str__() + " not set.") + + +fn string_flag( + name: String, + usage: String, + shorthand: String = "", + default: String = "", + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, +) -> Flag: + """Adds a `String` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + """ + return Flag(name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="String", + environment_variable=environment_variable, + file_path=file_path, + action=action, + ) \ No newline at end of file diff --git a/src/prism/util.mojo b/src/prism/util.mojo index 56200fc..a5f1ea8 100644 --- a/src/prism/util.mojo +++ b/src/prism/util.mojo @@ -1,5 +1,5 @@ from collections import InlineList -from memory import ArcPointer +from memory import ArcPointerPointer fn split(text: String, sep: String, max_split: Int = -1) -> List[String]: @@ -28,11 +28,7 @@ fn string_to_bool(value: String) -> Bool: Returns: The boolean equivalent of the string. """ - alias truthy = InlineList[String, 3]("true", "True", "1") - for i in range(len(truthy)): - if value == truthy[i]: - return True - return False + return value in ["true", "True", "1"] fn to_string[T: StringableCollectionElement](vector: List[ArcPointer[T]]) -> String: diff --git a/test/test_args.mojo b/test/test_args.mojo index bca3003..62d6ba8 100644 --- a/test/test_args.mojo +++ b/test/test_args.mojo @@ -1,4 +1,4 @@ -from memory import ArcPointer +from memory import ArcPointerPointer import testing from prism import Command, Context from prism.args import ( diff --git a/test/test_command.mojo b/test/test_command.mojo index d9f8a15..40761de 100644 --- a/test/test_command.mojo +++ b/test/test_command.mojo @@ -1,4 +1,4 @@ -from memory import ArcPointer +from memory import ArcPointerPointer import testing from prism.command import Command, Context from prism.flag_set import FlagSet diff --git a/test/test_flags.mojo b/test/test_flags.mojo index 1988056..034daa2 100644 --- a/test/test_flags.mojo +++ b/test/test_flags.mojo @@ -1,4 +1,4 @@ -from memory import ArcPointer +from memory import ArcPointerPointer import testing from prism.flag import Flag from prism.flag_set import FlagSet, string_to_bool From 909a84abfd6ba740f1d5323f3bfd16c478cb0986 Mon Sep 17 00:00:00 2001 From: Mikhail Tavarez Date: Tue, 24 Dec 2024 12:03:09 -0600 Subject: [PATCH 3/7] refactoring to not use flag sets --- examples/chromeria.mojo | 6 +- examples/fg_child.mojo | 63 +- examples/flag_action.mojo | 18 +- src/prism/__init__.mojo | 27 +- src/prism/args.mojo | 4 +- src/prism/command.mojo | 442 ++++++-- src/prism/context.mojo | 7 +- src/prism/flag.mojo | 52 +- src/prism/flag_group.mojo | 33 +- src/prism/flag_parser.mojo | 40 +- src/prism/flag_set.mojo | 2116 ++++++++++++++++-------------------- src/prism/util.mojo | 8 +- 12 files changed, 1515 insertions(+), 1301 deletions(-) diff --git a/examples/chromeria.mojo b/examples/chromeria.mojo index e222620..b6684a5 100644 --- a/examples/chromeria.mojo +++ b/examples/chromeria.mojo @@ -1,4 +1,4 @@ -from memory import ArcPointerPointer +from memory import ArcPointer from prism import Command, Context @@ -16,7 +16,9 @@ fn main() -> None: usage="This is a dummy command!", run=test, children=List[ArcPointer[Command]]( - ArcPointer(Command(name="chromeria", usage="This is a dummy command!", run=hello)) + ArcPointer(Command( + name="chromeria", usage="This is a dummy command!", run=hello + )) ), ) diff --git a/examples/fg_child.mojo b/examples/fg_child.mojo index e0922e8..5b9a9c8 100644 --- a/examples/fg_child.mojo +++ b/examples/fg_child.mojo @@ -1,5 +1,6 @@ from memory import ArcPointer from prism import Command, Context +import prism fn test(ctx: Context) -> None: @@ -15,21 +16,61 @@ fn main() -> None: name="my", usage="This is a dummy command!", run=test, + flags=List[prism.Flag]( + prism.bool_flag( + name="required", + shorthand="r", + usage="Always required.", + required=True, + ), + prism.string_flag( + name="host", + shorthand="h", + usage="Host", + ), + prism.string_flag( + name="port", + shorthand="p", + usage="Port", + ), + ), + children=List[ArcPointer[Command]]( + ArcPointer( + Command( + name="tool", + usage="This is a dummy command!", + run=tool_func, + flags=List[prism.Flag]( + prism.bool_flag( + name="also", + shorthand="a", + usage="Also always required.", + required=True, + ), + prism.string_flag( + name="uri", + shorthand="u", + usage="URI", + ), + ), + ) + ) + ), ) - root.persistent_flags.bool_flag(name="required", shorthand="r", usage="Always required.") - root.persistent_flags.string_flag(name="host", shorthand="h", usage="Host") - root.persistent_flags.string_flag(name="port", shorthand="p", usage="Port") - root.mark_persistent_flag_required("required") + # root.persistent_flags.bool_flag(name="required", shorthand="r", usage="Always required.") + # root.persistent_flags.string_flag(name="host", shorthand="h", usage="Host") + # root.persistent_flags.string_flag(name="port", shorthand="p", usage="Port") + # root.mark_persistent_flag_required("required") - var print_tool = Arc(Command(name="tool", usage="This is a dummy command!", run=tool_func)) - print_tool[].flags.bool_flag(name="also", shorthand="a", usage="Also always required.") - print_tool[].flags.string_flag(name="uri", shorthand="u", usage="URI") - root.add_subcommand(print_tool) + # var print_tool = ArcPointer(Command(name="tool", usage="This is a dummy command!", run=tool_func)) + # print_tool[].flags.bool_flag(name="also", shorthand="a", usage="Also always required.") + # print_tool[].flags.string_flag(name="uri", shorthand="u", usage="URI") + # root.add_subcommand(print_tool) # Make sure to add the child command to the parent before marking flags. # add_subcommand() will merge persistent flags from the parent into the child's flags. - print_tool[].mark_flag_required("also") - print_tool[].mark_flags_required_together("host", "port") - print_tool[].mark_flags_mutually_exclusive("host", "uri") + # print_tool[].mark_flag_required("also") + # print_tool[].mark_flags_required_together("host", "port") + # print_tool[].mark_flags_mutually_exclusive("host", "uri") root.execute() diff --git a/examples/flag_action.mojo b/examples/flag_action.mojo index 7bf7188..50b7066 100644 --- a/examples/flag_action.mojo +++ b/examples/flag_action.mojo @@ -1,9 +1,10 @@ from memory import ArcPointer -from prism import Command, Context +from prism import Command, Context, Flag +from prism.flag_set import string_flag fn test(ctx: Context) raises -> None: - name = ctx.command[].flags.get_string("name") + name = ctx.command[].get_string("name") print(String("Hello {}").format(name)) @@ -17,10 +18,15 @@ fn main() -> None: name="greet", usage="Greet a user!", raising_run=test, - ) - - root.flags.string_flag( - name="name", shorthand="n", usage="The name of the person to greet.", default="World", action=validate_name + flags=List[Flag]( + string_flag( + name="name", + shorthand="n", + usage="The name of the person to greet.", + default="World", + action=validate_name, + ) + ) ) root.execute() diff --git a/src/prism/__init__.mojo b/src/prism/__init__.mojo index 2f4bd4c..daa912d 100644 --- a/src/prism/__init__.mojo +++ b/src/prism/__init__.mojo @@ -1,9 +1,24 @@ -from .command import ( - Command, - CmdFn, - ArgValidatorFn, -) +from .command import Command from .args import no_args, valid_args, arbitrary_args, minimum_n_args, maximum_n_args, exact_args, range_args from .flag import Flag -from .flag_set import FlagSet +from .flag_set import ( + string_flag, + bool_flag, + int_flag, + int8_flag, + int16_flag, + int32_flag, + int64_flag, + uint_flag, + uint8_flag, + uint16_flag, + uint32_flag, + uint64_flag, + float16_flag, + float32_flag, + float64_flag, + string_list_flag, + int_list_flag, + float64_list_flag, +) from .context import Context diff --git a/src/prism/args.mojo b/src/prism/args.mojo index 101474a..e2cbe77 100644 --- a/src/prism/args.mojo +++ b/src/prism/args.mojo @@ -1,6 +1,6 @@ -from memory import ArcPointerPointer +from memory import ArcPointer from collections.optional import Optional -from .command import ArgValidatorFn +from .command import ArgValidatorFn, Command from .context import Context diff --git a/src/prism/command.mojo b/src/prism/command.mojo index be2a314..656dab4 100644 --- a/src/prism/command.mojo +++ b/src/prism/command.mojo @@ -1,11 +1,23 @@ from sys import argv from collections import Optional, Dict, InlineList -from memory import ArcPointerPointer +from memory import ArcPointer from os import abort import mog -from .util import to_string, to_list +from .util import to_string, to_list, string_to_bool from .flag import Flag -from .flag_set import FlagSet, validate_required_flags, REQUIRED, REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE +from .flag_set import ( + visit_all, + validate_required_flags, + from_args, + REQUIRED, + REQUIRED_AS_GROUP, + ONE_REQUIRED, + MUTUALLY_EXCLUSIVE, + set_as, + set_annotation, + bool_flag, + string_flag, +) from .flag_group import validate_flag_groups from .args import arbitrary_args, get_args from .context import Context @@ -16,7 +28,7 @@ fn concat_names(flag_names: VariadicListMem[String, _]) -> String: Args: flag_names: The flag names to concatenate. - + Returns: The concatenated flag names. """ @@ -31,7 +43,7 @@ fn concat_names(flag_names: VariadicListMem[String, _]) -> String: fn get_args_as_list() -> List[String]: """Returns the arguments passed to the executable as a list of strings. - + Returns: The arguments passed to the executable as a list of strings. """ @@ -53,10 +65,10 @@ fn default_help(mut command: ArcPointer[Command]) raises -> String: Args: command: The command to generate help information for. - + Returns: The help information for the command. - + Raises: Any error that occurs while generating the help information. """ @@ -79,9 +91,9 @@ fn default_help(mut command: ArcPointer[Command]) raises -> String: var usage = usage_style.render(mog.join_vertical(mog.left, builder, "\n", cmd[].usage)) builder = String() - if cmd[].flags.flags: + if cmd[].flags: builder.write(bold_style.render("Options")) - for flag in cmd[].flags.flags: + for flag in cmd[].flags: builder.write(option_style.render("\n-{}, --{}".format(flag[].shorthand, flag[].name))) builder.write(" {}".format(flag[].usage)) var options = border_style.render(builder) @@ -125,7 +137,7 @@ struct Command(CollectionElement, Writable, Stringable): """A struct representing a command that can be executed from the command line. ```mojo - from memory import ArcPointerPointer + from memory import ArcPointer from prism import Command, Context fn test(ctx: Context) -> None: @@ -185,16 +197,16 @@ struct Command(CollectionElement, Writable, Stringable): var valid_args: List[String] """Valid arguments for the command.""" - var local_flags: FlagSet + var local_flags: List[Flag] """Local flags for the command. TODO: Use this field to store cached results for local flags.""" - var persistent_flags: FlagSet + var persistent_flags: List[Flag] """Local flags that also persist to children.""" - var flags: FlagSet + var flags: List[Flag] """It is all local, persistent, and inherited flags.""" - var _inherited_flags: FlagSet + var _inherited_flags: List[Flag] """Cached results from self._merge_flags().""" var children: List[ArcPointer[Self]] @@ -207,6 +219,7 @@ struct Command(CollectionElement, Writable, Stringable): mut self, name: String, usage: String, + *, aliases: List[String] = List[String](), valid_args: List[String] = List[String](), children: List[ArcPointer[Self]] = List[ArcPointer[Self]](), @@ -220,6 +233,7 @@ struct Command(CollectionElement, Writable, Stringable): persistent_post_run: Optional[CmdFn] = None, persistent_raising_pre_run: Optional[RaisingCmdFn] = None, persistent_raising_post_run: Optional[RaisingCmdFn] = None, + flags: List[Flag] = List[Flag](), ): """Constructs a new `Command`. @@ -239,6 +253,7 @@ struct Command(CollectionElement, Writable, Stringable): persistent_post_run: The function to run after the command is executed. This persists to children. persistent_raising_pre_run: The function to run before the command is executed that returns an error. This persists to children. persistent_raising_post_run: The function to run after the command is executed that returns an error. This persists to children. + flags: The flags for the command. """ if not run and not raising_run: abort("A command must have a run or raising_run function.") @@ -269,11 +284,11 @@ struct Command(CollectionElement, Writable, Stringable): self.parent = List[ArcPointer[Self]](capacity=1) # These need to be mutable so we can add flags to them. - self.flags = FlagSet() - self.local_flags = FlagSet() - self.persistent_flags = FlagSet() - self._inherited_flags = FlagSet() - self.flags.bool_flag(name="help", shorthand="h", usage="Displays help information about the command.") + self.flags = flags + self.local_flags = List[Flag]() + self.persistent_flags = List[Flag]() + self._inherited_flags = List[Flag]() + self.flags.append(bool_flag(name="help", shorthand="h", usage="Displays help information about the command.")) fn __moveinit__(mut self, owned existing: Self): """Initializes a new `Command` by moving the fields from an existing `Command`. @@ -327,6 +342,7 @@ struct Command(CollectionElement, Writable, Stringable): Args: writer: The formatter to write to. """ + @parameter fn write_optional(opt: Optional[String]): if opt: @@ -348,12 +364,12 @@ struct Command(CollectionElement, Writable, Stringable): writer.write(self.valid_args.__str__()) if self.flags: writer.write(", Flags: ") - writer.write(self.flags) + writer.write(self.flags.__str__()) writer.write(")") fn full_name(self) -> String: """Traverses up the parent command tree to build the full command as a string. - + Returns: The full command name. """ @@ -364,7 +380,7 @@ struct Command(CollectionElement, Writable, Stringable): fn root(self) -> ArcPointer[Command]: """Returns the root command of the command tree. - + Returns: The root command in the tree. """ @@ -382,7 +398,7 @@ struct Command(CollectionElement, Writable, Stringable): arg: The argument to match against the command name or aliases. children: The children of the current command. leftover_start: The index to start the remaining arguments at. - + Returns: The command that matches the argument and the remaining children to traverse. """ @@ -398,7 +414,7 @@ struct Command(CollectionElement, Writable, Stringable): Args: args: The arguments to traverse the command tree with. - + Returns: The command that matches the arguments and the remaining arguments to pass to that command. """ @@ -424,11 +440,11 @@ struct Command(CollectionElement, Writable, Stringable): fn _execute_pre_run_hooks(self, ctx: Context, parents: List[ArcPointer[Self]]) raises -> None: """Runs the pre-run hooks for the command. - + Args: ctx: The context of the command being executed. parents: The parents of the command to check for persistent pre-run hooks. - + Raises: Any error that occurs while running the pre-run hooks. """ @@ -460,11 +476,11 @@ struct Command(CollectionElement, Writable, Stringable): fn _execute_post_run_hooks(self, ctx: Context, parents: List[ArcPointer[Self]]) raises -> None: """Runs the post-run hooks for the command. - + Args: ctx: The context of the command being executed. parents: The parents of the command to check for persistent post-run hooks. - + Raises: Any error that occurs while running the post-run hooks. """ @@ -527,10 +543,10 @@ struct Command(CollectionElement, Writable, Stringable): try: # Get the flags for the command to be executed. - var remaining_args = command.flags.from_args(remaining_args) + var remaining_args = from_args(command.flags, remaining_args) # Check if the help flag was passed - var help_passed = command.flags.get_bool("help") + var help_passed = command.get_bool("help") var command_ref = ArcPointer(command) if help_passed == True: print(command.help(command_ref)) @@ -543,14 +559,14 @@ struct Command(CollectionElement, Writable, Stringable): validate_flag_groups(command.flags) # Run flag actions if they have any - var ctx = Context(command_ref, remaining_args) + var ctx = Context(remaining_args, command_ref) @parameter fn run_action(flag: Flag) raises -> None: if flag.action and flag.value: flag.action.value()(ctx, flag.value.value()) - command.flags.visit_all[run_action]() + visit_all[run_action](command.flags) # Validate the remaining arguments command.arg_validator(ctx) @@ -565,19 +581,22 @@ struct Command(CollectionElement, Writable, Stringable): except e: abort(e) - fn inherited_flags(self) -> FlagSet: + fn inherited_flags(self) -> List[Flag]: """Returns the flags for the command and inherited flags from its parent. Returns: The flags for the command and its parent. """ - var flags = FlagSet() + var flags = List[Flag]() @parameter fn add_parent_persistent_flags(parent: ArcPointer[Self]) capturing -> None: - if parent[].persistent_flags: - flags += parent[].persistent_flags - + for flag in parent[].flags: + if flag[].persistent: + flags.append(flag[]) + # if parent[].persistent_flags: + # flags += parent[].persistent_flags + self.visit_parents[add_parent_persistent_flags]() return flags @@ -599,17 +618,17 @@ struct Command(CollectionElement, Writable, Stringable): else: command[].parent.append(self) - fn mark_flag_required(mut self, flag_name: String) -> None: - """Marks the given flag with annotations so that `Prism` errors - if the command is invoked without the flag. + # fn mark_flag_required(mut self, flag_name: String) -> None: + # """Marks the given flag with annotations so that `Prism` errors + # if the command is invoked without the flag. - Args: - flag_name: The name of the flag to mark as required. - """ - try: - self.flags.set_required(flag_name) - except e: - abort(e) + # Args: + # flag_name: The name of the flag to mark as required. + # """ + # try: + # self.flags.set_required(flag_name) + # except e: + # abort(e) fn mark_flags_required_together(mut self, *flag_names: String) -> None: """Marks the given flags with annotations so that `Prism` errors @@ -622,7 +641,7 @@ struct Command(CollectionElement, Writable, Stringable): var names = concat_names(flag_names) try: for flag_name in flag_names: - self.flags.set_as[REQUIRED_AS_GROUP](flag_name[], names) + set_as[REQUIRED_AS_GROUP](self.flags, flag_name[], names) except e: abort(e) @@ -637,7 +656,7 @@ struct Command(CollectionElement, Writable, Stringable): var names = concat_names(flag_names) try: for flag_name in flag_names: - self.flags.set_as[ONE_REQUIRED](flag_name[], names) + set_as[ONE_REQUIRED](self.flags, flag_name[], names) except e: abort(e) @@ -652,25 +671,25 @@ struct Command(CollectionElement, Writable, Stringable): var names = concat_names(flag_names) try: for flag_name in flag_names: - self.flags.set_as[MUTUALLY_EXCLUSIVE](flag_name[], names) + set_as[MUTUALLY_EXCLUSIVE](self.flags, flag_name[], names) except e: abort(e) - fn mark_persistent_flag_required(mut self, flag_name: String) -> None: - """Marks the given persistent flag with annotations so that `Prism` errors - if the command is invoked without the flag. + # fn mark_persistent_flag_required(mut self, flag_name: String) -> None: + # """Marks the given persistent flag with annotations so that `Prism` errors + # if the command is invoked without the flag. - Args: - flag_name: The name of the flag to mark as required. - """ - try: - self.persistent_flags.set_required(flag_name) - except e: - abort(e) + # Args: + # flag_name: The name of the flag to mark as required. + # """ + # try: + # self.persistent_flags.set_required(flag_name) + # except e: + # abort(e) fn has_parent(self) -> Bool: """Returns True if the command has a parent, False otherwise. - + Returns: True if the command has a parent, False otherwise. """ @@ -685,3 +704,304 @@ struct Command(CollectionElement, Writable, Stringable): if self.has_parent(): func(self.parent[0][]) self.parent[0][].visit_parents[func]() + + fn lookup(ref self, name: String, type: String = "") raises -> Pointer[Flag, __origin_of(self.flags)]: + """Returns an mutable or immutable Pointer to a Flag with the given name. + Mutable if FlagSet is mutable, immutable if FlagSet is immutable. + + Args: + name: The name of the Flag to lookup. + type: The type of the Flag to lookup. + + Returns: + Optional Pointer to the Flag. + + Raises: + Error: If the Flag is not found. + """ + if type == "": + for i in range(len(self.flags)): + if self.flags[i].name == name: + return Pointer.address_of(self.flags[i]) + else: + for i in range(len(self.flags)): + if self.flags[i].name == name and self.flags[i].type == type: + return Pointer.address_of(self.flags[i]) + + raise Error("FlagNotFoundError: Could not find the following flag: " + name) + + fn get_string(self, name: String) raises -> String: + """Returns the value of a flag as a `String`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `String`. + + Raises: + Error: If the flag is not found. + """ + return self.lookup(name, "String")[].value_or_default() + + fn get_bool(self, name: String) raises -> Bool: + """Returns the value of a flag as a `Bool`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Bool`. + + Raises: + Error: If the flag is not found. + """ + return string_to_bool(self.lookup(name, "Bool")[].value_or_default()) + + fn get_int(self, name: String, type: String = "Int") raises -> Int: + """Returns the value of a flag as an `Int`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + type: The type of the flag. + + Returns: + The value of the flag as an `Int`. + + Raises: + Error: If the flag is not found. + """ + return atol(self.lookup(name, type)[].value_or_default()) + + fn get_int8(self, name: String) raises -> Int8: + """Returns the value of a flag as a `Int8`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Int8`. + + Raises: + Error: If the flag is not found. + """ + return Int8(self.get_int(name, "Int8")) + + fn get_int16(self, name: String) raises -> Int16: + """Returns the value of a flag as a `Int16`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Int16`. + + Raises: + Error: If the flag is not found. + """ + return Int16(self.get_int(name, "Int16")) + + fn get_int32(self, name: String) raises -> Int32: + """Returns the value of a flag as a `Int32`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Int32`. + + Raises: + Error: If the flag is not found. + """ + return Int32(self.get_int(name, "Int32")) + + fn get_int64(self, name: String) raises -> Int64: + """Returns the value of a flag as a `Int64`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Int64`. + + Raises: + Error: If the flag is not found. + """ + return Int64(self.get_int(name, "Int64")) + + fn get_uint(self, name: String) raises -> UInt: + """Returns the value of a flag as a `UInt`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt`. + + Raises: + Error: If the flag is not found. + """ + return UInt(self.get_int(name, "UInt")) + + fn get_uint8(self, name: String) raises -> UInt8: + """Returns the value of a flag as a `UInt8`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt8`. + + Raises: + Error: If the flag is not found. + """ + return UInt8(self.get_int(name, "UInt8")) + + fn get_uint16(self, name: String) raises -> UInt16: + """Returns the value of a flag as a `UInt16`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt16`. + + Raises: + Error: If the flag is not found. + """ + return UInt16(self.get_int(name, "UInt16")) + + fn get_uint32(self, name: String) raises -> UInt32: + """Returns the value of a flag as a `UInt32`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt32`. + + Raises: + Error: If the flag is not found. + """ + return UInt32(self.get_int(name, "UInt32")) + + fn get_uint64(self, name: String) raises -> UInt64: + """Returns the value of a flag as a `UInt64`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `UInt64`. + + Raises: + Error: If the flag is not found. + """ + return UInt64(self.get_int(name, "UInt64")) + + fn get_float16(self, name: String) raises -> Float16: + """Returns the value of a flag as a `Float16`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Float16`. + + Raises: + Error: If the flag is not found. + """ + return self.get_float64(name).cast[DType.float16]() + + fn get_float32(self, name: String) raises -> Float32: + """Returns the value of a flag as a `Float32`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Float32`. + + Raises: + Error: If the flag is not found. + """ + return self.get_float64(name).cast[DType.float32]() + + fn get_float64(self, name: String) raises -> Float64: + """Returns the value of a flag as a `Float64`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Float64`. + + Raises: + Error: If the flag is not found. + """ + return atof(self.lookup(name, "Float64")[].value_or_default()) + + fn _get_list(self, name: String, type: String) raises -> List[String]: + """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + type: The type of the flag. + + Returns: + The value of the flag as a `List[String]`. + + Raises: + Error: If the flag is not found. + """ + return self.lookup(name, type)[].value_or_default().split(sep=" ") + + fn get_string_list(self, name: String) raises -> List[String]: + """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `List[String]`. + + Raises: + Error: If the flag is not found. + """ + return self._get_list(name, "StringList") + + fn get_int_list(self, name: String) raises -> List[Int]: + """Returns the value of a flag as a `List[Int]`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `List[Int]`. + + Raises: + Error: If the flag is not found. + """ + var values = self._get_list(name, "IntList") + var ints = List[Int](capacity=len(values)) + for value in values: + ints.append(atol(value[])) + return ints + + fn get_float64_list(self, name: String) raises -> List[Float64]: + """Returns the value of a flag as a `List[Float64]`. If it isn't set, then return the default value. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `List[Float64]`. + + Raises: + Error: If the flag is not found. + """ + var values = self._get_list(name, "Float64List") + var floats = List[Float64](capacity=len(values)) + for value in values: + floats.append(atof(value[])) + return floats diff --git a/src/prism/context.mojo b/src/prism/context.mojo index e557b93..6a800fa 100644 --- a/src/prism/context.mojo +++ b/src/prism/context.mojo @@ -1,20 +1,21 @@ -from memory import ArcPointerPointer +from memory import ArcPointer from .command import Command struct Context: """The context of the command being executed, a pointer to the command and the args to use.""" + var command: ArcPointer[Command] """The command being executed.""" var args: List[String] """The arguments passed to the command.""" - def __init__(mut self, command: ArcPointer[Command], args: List[String]) -> None: + def __init__(mut self, args: List[String], command: ArcPointer[Command]) -> None: """Initializes a new Context. Args: - command: The command being executed. args: The arguments passed to the command. + command: The command being executed. """ self.command = command self.args = args diff --git a/src/prism/flag.mojo b/src/prism/flag.mojo index 7fba0fd..84c6ef3 100644 --- a/src/prism/flag.mojo +++ b/src/prism/flag.mojo @@ -33,19 +33,25 @@ struct Flag(RepresentableCollectionElement, Stringable, Writable): var action: Optional[FlagActionFn] """Function to run after the flag has been processed.""" var changed: Bool - """Whether the flag has been changed from its default value.""" + """If the flag has been changed from its default value.""" + var required: Bool + """If the flag is required.""" + var persistent: Bool + """If the flag should persist to children commands.""" fn __init__( mut self, name: String, type: String, + *, shorthand: String = "", usage: String = "", - value: Optional[String] = None, environment_variable: Optional[StringLiteral] = None, file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, default: String = "", + required: Bool = False, + persistent: Bool = False, ) -> None: """Initializes a new Flag. @@ -54,16 +60,17 @@ struct Flag(RepresentableCollectionElement, Stringable, Writable): type: The type of the flag. shorthand: The shorthand of the flag. usage: The usage of the flag. - value: The value of the flag. environment_variable: The environment variable to check for a value. file_path: The file to check for a value. action: Function to run after the flag has been processed. default: The default value of the flag. + required: If the flag is required. + persistent: If the flag should persist to children commands. """ self.name = name self.shorthand = shorthand self.usage = usage - self.value = value + self.value = None self.environment_variable = environment_variable self.file_path = file_path self.default = default @@ -71,6 +78,8 @@ struct Flag(RepresentableCollectionElement, Stringable, Writable): self.annotations = Dict[String, List[String]]() self.action = action self.changed = False + self.required = required + self.persistent = persistent fn __str__(self) -> String: """Returns a string representation of the Flag. @@ -93,7 +102,7 @@ struct Flag(RepresentableCollectionElement, Stringable, Writable): Args: other: The other Flag to compare against. - + Returns: True if the Flags are equal, False otherwise. """ @@ -112,7 +121,7 @@ struct Flag(RepresentableCollectionElement, Stringable, Writable): Args: other: The other Flag to compare against. - + Returns: True if the Flags are not equal, False otherwise. """ @@ -135,25 +144,26 @@ struct Flag(RepresentableCollectionElement, Stringable, Writable): else: writer.write(repr(None)) - writer.write("Flag(name=") - writer.write(self.name) - + writer.write("Flag(name=", self.name) if self.shorthand != "": - writer.write(", shorthand=") - writer.write(self.shorthand) - writer.write(", Usage=") - writer.write(self.usage) - + writer.write(", shorthand=", self.shorthand) + writer.write(", Usage=", self.usage) if self.value: writer.write(", value=") write_optional(self.value) - writer.write(", default=") - writer.write(self.default) - writer.write(", type=") - writer.write(self.type) - writer.write(", changed=") - writer.write(self.changed) - writer.write(")") + writer.write( + ", default=", + self.default, + ", type=", + self.type, + ", changed=", + self.changed, + ", required=", + self.required, + ", persistent=", + self.persistent, + ")", + ) fn set(mut self, value: String) -> None: """Sets the value of the flag. diff --git a/src/prism/flag_group.mojo b/src/prism/flag_group.mojo index 9bfcc02..ac70b70 100644 --- a/src/prism/flag_group.mojo +++ b/src/prism/flag_group.mojo @@ -1,29 +1,28 @@ from collections import Dict from os import abort from .flag import Flag -from .flag_set import REQUIRED, REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE +from .flag_set import REQUIRED, REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE, visit_all -fn has_all_flags(flags: FlagSet, flag_names: List[String]) -> Bool: +fn has_all_flags(flags: List[Flag], flag_names: List[String]) -> Bool: """Checks if all flags are defined in the FlagSet. Args: flags: The FlagSet to check for the flags. flag_names: The names of the flags to check for. - + Returns: True if all flags are defined, False otherwise. """ for name in flag_names: - try: - _ = flags.lookup(name[]) - except: - return False - return True + for flag in flags: + if flag[].name == name[]: + return True + return False fn process_flag_for_group_annotation( - flags: FlagSet, + flags: List[Flag], flag: Flag, annotation: String, mut group_status: Dict[String, Dict[String, Bool]], @@ -35,7 +34,7 @@ fn process_flag_for_group_annotation( flag: The flag to process. annotation: The annotation to check for. group_status: The status of the flag groups. - + Raises: Error: If an error occurred while processing the flag. """ @@ -72,7 +71,7 @@ fn validate_required_flag_group(data: Dict[String, Dict[String, Bool]]) raises - Args: data: The dictionary of flag groups to validate. - + Raises: Error: If an error occurred while validating the flag groups. """ @@ -107,7 +106,7 @@ fn validate_one_required_flag_group(data: Dict[String, Dict[String, Bool]]) rais Args: data: The dictionary of flag groups to validate. - + Raises: Error: If an error occurred while validating the flag groups. """ @@ -136,7 +135,7 @@ fn validate_mutually_exclusive_flag_group(data: Dict[String, Dict[String, Bool]] Args: data: The dictionary of flag groups to validate. - + Raises: Error: If an error occurred while validating the flag groups. """ @@ -177,7 +176,7 @@ fn validate_flag_groups( group_status: The status of flag groups that are required together. one_required_group_status: The status of flag groups that require at least one flag to be set. mutually_exclusive_group_status: The status of flag groups that are mutually exclusive. - + Raises: Error: If an error occurred while validating the flag groups. """ @@ -186,12 +185,12 @@ fn validate_flag_groups( validate_mutually_exclusive_flag_group(mutually_exclusive_group_status) -fn validate_flag_groups(flags: FlagSet) raises -> None: +fn validate_flag_groups(flags: List[Flag]) raises -> None: """Validates the status of flag groups. Args: flags: The flags to validate. - + Raises: Error: If an error occurred while validating the flag groups. """ @@ -205,7 +204,7 @@ fn validate_flag_groups(flags: FlagSet) raises -> None: process_flag_for_group_annotation(flags, flag, ONE_REQUIRED, one_required_group_status) process_flag_for_group_annotation(flags, flag, MUTUALLY_EXCLUSIVE, mutually_exclusive_group_status) - flags.visit_all[flag_checker]() + visit_all[flag_checker](flags) # Validate required flag groups validate_flag_groups(group_status, one_required_group_status, mutually_exclusive_group_status) diff --git a/src/prism/flag_parser.mojo b/src/prism/flag_parser.mojo index fbedce6..ba0fa5f 100644 --- a/src/prism/flag_parser.mojo +++ b/src/prism/flag_parser.mojo @@ -1,7 +1,7 @@ import os from memory import Span from collections import InlineArray -from .flag_set import FlagSet +from .flag_set import names, lookup, lookup_name from .util import split @@ -15,17 +15,19 @@ struct FlagParser: """Initializes the FlagParser.""" self.index = 0 - fn parse_flag(self, argument: String, arguments: Span[String], flags: FlagSet) raises -> Tuple[String, String, Int]: + fn parse_flag( + self, argument: String, arguments: Span[String], flags: List[Flag] + ) raises -> Tuple[String, String, Int]: """Parses a flag and returns the name, value, and the index to increment by. Args: argument: The argument to parse. arguments: The list of arguments passed via the command line. flags: The flags passed via the command line. - + Returns: The name, value, the index to increment by, and an error if one occurred. - + Raises: Error: If an error occurred while parsing the flag. """ @@ -35,19 +37,19 @@ struct FlagParser: var name = flag[0][2:] var value = flag[1] - if name not in flags.names(): + if name not in names(flags): raise Error("Command does not accept the flag supplied: " + name) return name, value, 1 # Flag with value set like "--flag " var name = argument[2:] - if name not in flags.names(): + if name not in names(flags): raise Error("Command does not accept the flag supplied: " + name) # If it's a bool flag, set it to True and only increment the index by 1 (one arg used). try: - _ = flags.lookup(name, "Bool") + _ = lookup(flags, name, "Bool") return name, String("True"), 1 except: pass @@ -62,7 +64,7 @@ struct FlagParser: return name, arguments[self.index + 1], 2 fn parse_shorthand_flag( - self, argument: String, arguments: Span[String], flags: FlagSet + self, argument: String, arguments: Span[String], flags: List[Flag] ) raises -> Tuple[String, String, Int]: """Parses a shorthand flag and returns the name, value, and the index to increment by. @@ -73,7 +75,7 @@ struct FlagParser: Returns: The name, value, the index to increment by, and an error if one occurred. - + Raises: Error: If an error occurred while parsing the shorthand flag. """ @@ -82,21 +84,21 @@ struct FlagParser: var flag = split(argument, "=") var shorthand = flag[0][1:] var value = flag[1] - var name = flags.lookup_name(shorthand) - if name not in flags.names(): + var name = lookup_name(flags, shorthand) + if name not in names(flags): raise Error("Command does not accept the shorthand flag supplied: " + name) return name, value, 1 # Flag with value set like "-f " var shorthand = argument[1:] - var name = flags.lookup_name(shorthand) - if name not in flags.names(): + var name = lookup_name(flags, shorthand) + if name not in names(flags): raise Error("Command does not accept the shorthand flag supplied: " + shorthand) # If it's a bool flag, set it to True and only increment the index by 1 (one arg used). try: - _ = flags.lookup(name, "Bool") + _ = lookup(flags, name, "Bool") return name, String("True"), 1 except: pass @@ -111,16 +113,16 @@ struct FlagParser: return name, arguments[self.index + 1], 2 # TODO: This parsing is dirty atm, will come back around and clean it up. - fn parse(mut self, mut flags: FlagSet, arguments: List[String]) raises -> List[String]: + fn parse(mut self, mut flags: List[Flag], arguments: List[String]) raises -> List[String]: """Parses flags and args from the args passed via the command line and adds them to their appropriate collections. Args: flags: The flags to parse. arguments: The arguments passed via the command line. - + Returns: The arguments that are not flags. - + Raises: Error: If an error occurred while parsing the flags. """ @@ -149,7 +151,7 @@ struct FlagParser: # Set the value of the flag. alias list_types = InlineArray[String, 3]("StringList", "IntList", "Float64List") - var flag = flags.lookup(name) + var flag = lookup(flags, name) if flag[].type in list_types: if not flag[].changed: flag[].set(value) @@ -161,7 +163,7 @@ struct FlagParser: # If flags are not set, check if they can be set from an environment variable or from a file. # Set it from that value if there is one available. - for flag in flags.flags: + for flag in flags: if not flag[].value: if flag[].environment_variable: value = os.getenv(flag[].environment_variable.value()) diff --git a/src/prism/flag_set.mojo b/src/prism/flag_set.mojo index 4fe5099..73325a2 100644 --- a/src/prism/flag_set.mojo +++ b/src/prism/flag_set.mojo @@ -20,1168 +20,284 @@ alias ONE_REQUIRED = "ONE_REQUIRED" alias MUTUALLY_EXCLUSIVE = "MUTUALLY_EXCLUSIVE" -@value -struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparable): - """Represents a set of flags.""" - var flags: List[Flag] - """The list of flags in the flag set.""" - - fn __init__(mut self) -> None: - """Initializes a new FlagSet.""" - self.flags = List[Flag]() - - fn __init__(mut self, other: FlagSet) -> None: - """Initializes a new FlagSet from another FlagSet. - - Args: - other: The other FlagSet to copy from. - """ - self.flags = other.flags - - fn __str__(self) -> String: - """Returns a string representation of the FlagSet. - - Returns: - The string representation of the FlagSet. - """ - return String.write(self) - - fn write_to[W: Writer, //](self, mut writer: W): - """Write a string representation to a writer. - - Parameters: - W: The type of writer to write to. - - Args: - writer: The writer to write to. - """ - writer.write("FlagSet: [") - for i in range(self.flags.size): - writer.write(self.flags[i]) - if i != self.flags.size - 1: - writer.write(", ") - writer.write("]") - - fn __len__(self) -> Int: - """Returns the number of flags in the flag set. - - Returns: - The number of flags in the flag set. - """ - return self.flags.size - - fn __bool__(self) -> Bool: - """Returns whether the flag set is empty. - - Returns: - Whether the flag set is empty. - """ - return self.flags.__bool__() - - fn __contains__(self, value: Flag) -> Bool: - """Returns whether the flag set contains a flag. - - Args: - value: The flag to check for. - - Returns: - Whether the flag set contains the flag. - """ - return value in self.flags - - fn __eq__(self, other: Self) -> Bool: - """Compares two FlagSets for equality. - - Args: - other: The other FlagSet to compare against. - - Returns: - True if the FlagSets are equal, False otherwise. - """ - return self.flags == other.flags - - fn __ne__(self, other: Self) -> Bool: - """Compares two FlagSets for inequality. - - Args: - other: The other FlagSet to compare against. - - Returns: - True if the FlagSets are not equal, False otherwise. - """ - return self.flags != other.flags - - fn __add__(mut self, other: Self) -> Self: - """Merges two FlagSets together. - - Args: - other: The other FlagSet to merge with. - - Returns: - A new FlagSet with the merged flags. - """ - new = Self(self) - for flag in other.flags: - new.flags.append(flag[]) - return new - - fn __iadd__(mut self, other: Self): - """Merges another FlagSet into this FlagSet. - - Args: - other: The other FlagSet to merge with. - """ - self.merge(other) - - fn lookup(ref self, name: String, type: String = "") raises -> Pointer[Flag, __origin_of(self.flags)]: - """Returns an mutable or immutable Pointer to a Flag with the given name. - Mutable if FlagSet is mutable, immutable if FlagSet is immutable. - - Args: - name: The name of the Flag to lookup. - type: The type of the Flag to lookup. - - Returns: - Optional Pointer to the Flag. - - Raises: - Error: If the Flag is not found. - """ - if type == "": - for i in range(len(self.flags)): - if self.flags[i].name == name: - return Pointer.address_of(self.flags[i]) - else: - for i in range(len(self.flags)): - if self.flags[i].name == name and self.flags[i].type == type: - return Pointer.address_of(self.flags[i]) - - raise Error("FlagNotFoundError: Could not find the following flag: " + name) - - fn lookup_name(self, shorthand: String) raises -> String: - """Returns the name of a flag given its shorthand. - - Args: - shorthand: The shorthand of the flag to lookup. - - Returns: - The name of the flag. - - Raises: - Error: If the flag is not found. - """ - for flag in self.flags: - if flag[].shorthand and flag[].shorthand == shorthand: - return flag[].name - - raise Error("FlagNotFoundError: Could not find the following flag shorthand: " + shorthand) - - fn get_as[ - R: CollectionElement, //, transform: fn (flag_set: FlagSet, name: String) raises -> R - ](self, name: String) raises -> R: - """Returns the value of a flag as a specific type. - - Parameters: - R: The type to return the flag as. - transform: The transformation to apply to the flag value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as the specified type. - - Raises: - Error: If the flag is not found. - """ - return transform(self, name) - - fn get_string(self, name: String) raises -> String: - """Returns the value of a flag as a `String`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `String`. - - Raises: - Error: If the flag is not found. - """ - return self.lookup(name, "String")[].value_or_default() - - fn get_bool(self, name: String) raises -> Bool: - """Returns the value of a flag as a `Bool`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `Bool`. - - Raises: - Error: If the flag is not found. - """ - return string_to_bool(self.lookup(name, "Bool")[].value_or_default()) - - fn get_int(self, name: String, type: String = "Int") raises -> Int: - """Returns the value of a flag as an `Int`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - type: The type of the flag. - - Returns: - The value of the flag as an `Int`. - - Raises: - Error: If the flag is not found. - """ - return atol(self.lookup(name, type)[].value_or_default()) - - fn get_int8(self, name: String) raises -> Int8: - """Returns the value of a flag as a `Int8`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `Int8`. - - Raises: - Error: If the flag is not found. - """ - return Int8(self.get_int(name, "Int8")) - - fn get_int16(self, name: String) raises -> Int16: - """Returns the value of a flag as a `Int16`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `Int16`. - - Raises: - Error: If the flag is not found. - """ - return Int16(self.get_int(name, "Int16")) - - fn get_int32(self, name: String) raises -> Int32: - """Returns the value of a flag as a `Int32`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `Int32`. - - Raises: - Error: If the flag is not found. - """ - return Int32(self.get_int(name, "Int32")) - - fn get_int64(self, name: String) raises -> Int64: - """Returns the value of a flag as a `Int64`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `Int64`. - - Raises: - Error: If the flag is not found. - """ - return Int64(self.get_int(name, "Int64")) - - fn get_uint8(self, name: String) raises -> UInt8: - """Returns the value of a flag as a `UInt8`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `UInt8`. - - Raises: - Error: If the flag is not found. - """ - return UInt8(self.get_int(name, "UInt8")) - - fn get_uint16(self, name: String) raises -> UInt16: - """Returns the value of a flag as a `UInt16`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `UInt16`. - - Raises: - Error: If the flag is not found. - """ - return UInt16(self.get_int(name, "UInt16")) - - fn get_uint32(self, name: String) raises -> UInt32: - """Returns the value of a flag as a `UInt32`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `UInt32`. - - Raises: - Error: If the flag is not found. - """ - return UInt32(self.get_int(name, "UInt32")) - - fn get_uint64(self, name: String) raises -> UInt64: - """Returns the value of a flag as a `UInt64`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `UInt64`. - - Raises: - Error: If the flag is not found. - """ - return UInt64(self.get_int(name, "UInt64")) - - fn get_float16(self, name: String) raises -> Float16: - """Returns the value of a flag as a `Float16`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `Float16`. - - Raises: - Error: If the flag is not found. - """ - return self.get_float64(name).cast[DType.float16]() - - fn get_float32(self, name: String) raises -> Float32: - """Returns the value of a flag as a `Float32`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `Float32`. - - Raises: - Error: If the flag is not found. - """ - return self.get_float64(name).cast[DType.float32]() - - fn get_float64(self, name: String) raises -> Float64: - """Returns the value of a flag as a `Float64`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `Float64`. - - Raises: - Error: If the flag is not found. - """ - return atof(self.lookup(name, "Float64")[].value_or_default()) - - fn _get_list(self, name: String, type: String) raises -> List[String]: - """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - type: The type of the flag. - - Returns: - The value of the flag as a `List[String]`. - - Raises: - Error: If the flag is not found. - """ - return self.lookup(name, type)[].value_or_default().split(sep=" ") - - fn get_string_list(self, name: String) raises -> List[String]: - """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `List[String]`. - - Raises: - Error: If the flag is not found. - """ - return self._get_list(name, "StringList") - - fn get_int_list(self, name: String) raises -> List[Int]: - """Returns the value of a flag as a `List[Int]`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `List[Int]`. - - Raises: - Error: If the flag is not found. - """ - var values = self._get_list(name, "IntList") - var ints = List[Int](capacity=len(values)) - for value in values: - ints.append(atol(value[])) - return ints - - fn get_float64_list(self, name: String) raises -> List[Float64]: - """Returns the value of a flag as a `List[Float64]`. If it isn't set, then return the default value. - - Args: - name: The name of the flag. - - Returns: - The value of the flag as a `List[Float64]`. - - Raises: - Error: If the flag is not found. - """ - var values = self._get_list(name, "Float64List") - var floats = List[Float64](capacity=len(values)) - for value in values: - floats.append(atof(value[])) - return floats - - fn names(self) -> List[String]: - """Returns a list of names of all flags in the flag set. - - Returns: - A list of names of all flags in the flag set. - """ - var result = List[String](capacity=len(self.flags)) - for flag in self.flags: - result.append(flag[].name) - return result - - fn shorthands(self) -> List[String]: - """Returns a list of shorthands of all flags in the flag set. - - Returns: - A list of shorthands of all flags in the flag set. - """ - var result = List[String](capacity=len(self.flags)) - for flag in self.flags: - if flag[].shorthand: - result.append(flag[].shorthand) - return result - - fn bool_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Bool = False, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `Bool` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Bool", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# @value +# struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparable): +# """Represents a set of flags.""" + +# var flags: List[Flag] +# """The list of flags in the flag set.""" - fn string_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: String = "", - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `String` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="String", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# fn __init__(mut self) -> None: +# """Initializes a new FlagSet.""" +# self.flags = List[Flag]() - fn int_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Int = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds an `Int` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# fn __init__(mut self, other: FlagSet) -> None: +# """Initializes a new FlagSet from another FlagSet. - fn int8_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Int8 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds an `Int8` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int8", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# Args: +# other: The other FlagSet to copy from. +# """ +# self.flags = other.flags - fn int16_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Int16 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds an `Int16` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int16", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# fn __str__(self) -> String: +# """Returns a string representation of the FlagSet. - fn int32_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Int32 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds an `Int32` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int32", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# Returns: +# The string representation of the FlagSet. +# """ +# return String.write(self) + +# fn write_to[W: Writer, //](self, mut writer: W): +# """Write a string representation to a writer. + +# Parameters: +# W: The type of writer to write to. - fn int64_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Int64 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds an `Int64` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int64", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# Args: +# writer: The writer to write to. +# """ +# writer.write("FlagSet: [") +# for i in range(self.flags.size): +# writer.write(self.flags[i]) +# if i != self.flags.size - 1: +# writer.write(", ") +# writer.write("]") - fn uint8_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: UInt8 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `UInt8` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt8", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# fn __len__(self) -> Int: +# """Returns the number of flags in the flag set. - fn uint16_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: UInt16 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `UInt16` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt16", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# Returns: +# The number of flags in the flag set. +# """ +# return self.flags.size - fn uint32_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: UInt32 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `UInt32` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt32", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# fn __bool__(self) -> Bool: +# """Returns whether the flag set is empty. - fn uint64_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: UInt64 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `UInt64` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt64", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# Returns: +# Whether the flag set is empty. +# """ +# return self.flags.__bool__() - fn float16_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Float16 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `Float16` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Float16", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# fn __contains__(self, value: Flag) -> Bool: +# """Returns whether the flag set contains a flag. - fn float32_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Float32 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `Float32` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Float32", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# Args: +# value: The flag to check for. - fn float64_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: Float64 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `Float64` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Float64", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# Returns: +# Whether the flag set contains the flag. +# """ +# return value in self.flags - fn string_list_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: List[String] = List[String](), - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `StringList` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=" ".join(default), - type="StringList", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# fn __eq__(self, other: Self) -> Bool: +# """Compares two FlagSets for equality. - fn int_list_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: List[Int, True] = List[Int, True](), - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `IntList` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=" ".join(default), - type="IntList", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) - ) +# Args: +# other: The other FlagSet to compare against. + +# Returns: +# True if the FlagSets are equal, False otherwise. +# """ +# return self.flags == other.flags + +# fn __ne__(self, other: Self) -> Bool: +# """Compares two FlagSets for inequality. + +# Args: +# other: The other FlagSet to compare against. + +# Returns: +# True if the FlagSets are not equal, False otherwise. +# """ +# return self.flags != other.flags + +# fn __add__(mut self, other: Self) -> Self: +# """Merges two FlagSets together. + +# Args: +# other: The other FlagSet to merge with. + +# Returns: +# A new FlagSet with the merged flags. +# """ +# new = Self(self) +# for flag in other.flags: +# new.flags.append(flag[]) +# return new + +# fn __iadd__(mut self, other: Self): +# """Merges another FlagSet into this FlagSet. + +# Args: +# other: The other FlagSet to merge with. +# """ +# self.merge(other) + +# fn merge(mut self, new_set: Self) -> None: +# """Adds flags from another FlagSet. If a flag is already present, the flag from the new set is ignored. + +# Args: +# new_set: The flag set to add. +# """ + +# @always_inline +# fn add_flag(flag: Flag) capturing -> None: +# try: +# _ = self.lookup(flag.name) +# except e: +# if str(e).find("FlagNotFoundError") != -1: +# self.flags.append(flag) + +# visit_all[add_flag](new_set.flags) + + +fn set_annotation(mut flags: List[Flag], name: String, key: String, values: String) raises -> None: + """Sets an annotation for a flag. + + Args: + flags: The flags to set the annotation for. + name: The name of the flag to set the annotation for. + key: The key of the annotation. + values: The values of the annotation. + + Raises: + Error: If setting the value for the annotation fails. + """ + # Annotation value can be a concatenated string of values. + # Why? Because we can have multiple required groups of flags for example. + # So each value of the list for the annotation can be a group of flag names. + var flag = lookup(flags, name) + try: + # TODO: remove running 2 lookups when ref can return a Pointer + # we can store as a without copying the result. + flag[].annotations[key].extend(values) + except: + flag[].annotations[key] = List[String](values) + + +fn set_required(mut flags: List[Flag], name: String) raises -> None: + """Sets a flag as required or not. + + Args: + flags: The flags to set the required flag for. + name: The name of the flag to set as required. + + Raises: + Error: If setting the value for the annotation fails. + """ + try: + set_annotation(flags, name, REQUIRED, "true") + except e: + print("FlagSet.set_required: Failed to set flag, {}, to required.".format(name), file=2) + raise e + + +fn set_as[annotation_type: String](mut flags: List[Flag], name: String, names: String) raises -> None: + """Sets a flag as a specific annotation type. + + Parameters: + annotation_type: The type of annotation to set. + + Args: + flags: The flags to set the annotation for. + name: The name of the flag to set the annotation for. + names: The values of the annotation. - fn float64_list_flag( - mut self, - name: String, - usage: String, - shorthand: String = "", - default: List[Float64, True] = List[Float64, True](), - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - ) -> None: - """Adds a `Float64List` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - """ - self.flags.append( - Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=" ".join(default), - type="Float64List", - environment_variable=environment_variable, - file_path=file_path, - action=action, - ) + Raises: + Error: If the annotation type is not one of `REQUIRED_AS_GROUP`, `ONE_REQUIRED`, or `MUTUALLY_EXCLUSIVE`. + """ + constrained[ + annotation_type not in [REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE], + "annotation_type must be one of REQUIRED_AS_GROUP, ONE_REQUIRED, or MUTUALLY_EXCLUSIVE.", + ]() + try: + set_annotation(flags, name, annotation_type, names) + except e: + print( + "FlagSet.set_as: Failed to set flag, {}, with the following annotation: {}".format(name, annotation_type), + file=2, ) + raise e + + +fn from_args(mut flags: List[Flag], arguments: List[String]) raises -> List[String]: + """Parses flags and args from the args passed via the command line and adds them to their appropriate collections. + + Args: + flags: The flags to parse. + arguments: The arguments passed via the command line. + + Returns: + The remaining arguments after parsing out flags. + + Raises: + Error: If a flag is not recognized. + """ + var parser = FlagParser() + return parser.parse(flags, arguments) + + +fn names(flags: List[Flag]) -> List[String]: + """Returns a list of names of all flags in the flag set. + + Args: + flags: The flags to get the names for. + + Returns: + A list of names of all flags in the flag set. + """ + var result = List[String](capacity=len(flags)) + for flag in flags: + result.append(flag[].name) + return result - fn set_annotation(mut self, name: String, key: String, values: String) raises -> None: - """Sets an annotation for a flag. - - Args: - name: The name of the flag to set the annotation for. - key: The key of the annotation. - values: The values of the annotation. - - Raises: - Error: If setting the value for the annotation fails. - """ - # Annotation value can be a concatenated string of values. - # Why? Because we can have multiple required groups of flags for example. - # So each value of the list for the annotation can be a group of flag names. - try: - # TODO: remove running 2 lookups when ref can return a Pointer - # we can store as a without copying the result. - self.lookup(name)[].annotations[key].extend(values) - except: - self.lookup(name)[].annotations[key] = List[String](values) - - fn set_required(mut self, name: String) raises -> None: - """Sets a flag as required or not. - - Args: - name: The name of the flag to set as required. - - Raises: - Error: If setting the value for the annotation fails. - """ - try: - self.set_annotation(name, REQUIRED, "true") - except e: - print("FlagSet.set_required: Failed to set flag, {}, to required.".format(name), file=2) - raise e - - fn set_as[annotation_type: String](mut self, name: String, names: String) raises -> None: - """Sets a flag as a specific annotation type. - - Parameters: - annotation_type: The type of annotation to set. - - Args: - name: The name of the flag to set the annotation for. - names: The values of the annotation. - - Raises: - Error: If the annotation type is not one of `REQUIRED_AS_GROUP`, `ONE_REQUIRED`, or `MUTUALLY_EXCLUSIVE`. - """ - constrained[ - annotation_type not in [REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE], - "annotation_type must be one of REQUIRED_AS_GROUP, ONE_REQUIRED, or MUTUALLY_EXCLUSIVE.", - ]() - try: - self.set_annotation(name, annotation_type, names) - except e: - print( - "FlagSet.set_as: Failed to set flag, {}, with the following annotation: {}".format( - name, annotation_type - ), - file=2, - ) - raise e - - fn visit_all[visitor: FlagVisitorFn](self) -> None: - """Visits all flags in the flag set. - - Parameters: - visitor: The visitor function to call for each flag. - """ - for flag in self.flags: - visitor(flag[]) - - fn visit_all[visitor: FlagVisitorRaisingFn](self) raises -> None: - """Visits all flags in the flag set. - - Parameters: - visitor: The visitor function to call for each flag. - - Raises: - Error: If the visitor raises an error. - """ - for flag in self.flags: - visitor(flag[]) - - fn merge(mut self, new_set: Self) -> None: - """Adds flags from another FlagSet. If a flag is already present, the flag from the new set is ignored. - - Args: - new_set: The flag set to add. - """ - @always_inline - fn add_flag(flag: Flag) capturing -> None: - try: - _ = self.lookup(flag.name) - except e: - if str(e).find("FlagNotFoundError") != -1: - self.flags.append(flag) - - new_set.visit_all[add_flag]() - - fn from_args(mut self, arguments: List[String]) raises -> List[String]: - """Parses flags and args from the args passed via the command line and adds them to their appropriate collections. - - Args: - arguments: The arguments passed via the command line. - - Returns: - The remaining arguments after parsing out flags. - - Raises: - Error: If a flag is not recognized. - """ - var parser = FlagParser() - return parser.parse(self, arguments) - - -fn validate_required_flags(flags: FlagSet) raises -> None: + +fn shorthands(flags: List[Flag]) -> List[String]: + """Returns a list of shorthands of all flags in the flag set. + + Args: + flags: The flags to get the shorthands for. + + Returns: + A list of shorthands of all flags in the flag set. + """ + var result = List[String](capacity=len(flags)) + for flag in flags: + if flag[].shorthand: + result.append(flag[].shorthand) + return result + + +fn visit_all[visitor: FlagVisitorFn](flags: List[Flag]) -> None: + """Visits all flags in the flag set. + + Parameters: + visitor: The visitor function to call for each flag. + """ + for flag in flags: + visitor(flag[]) + + +fn visit_all[visitor: FlagVisitorRaisingFn](flags: List[Flag]) raises -> None: + """Visits all flags in the flag set. + + Parameters: + visitor: The visitor function to call for each flag. + + Raises: + Error: If the visitor raises an error. + """ + for flag in flags: + visitor(flag[]) + + +fn validate_required_flags(flags: List[Flag]) raises -> None: """Validates all required flags are present and returns an error otherwise. - + Args: flags: The flags to validate. - + Raises: Error: If a required flag is not set. """ @@ -1189,17 +305,66 @@ fn validate_required_flags(flags: FlagSet) raises -> None: @parameter fn check_required_flag(flag: Flag) -> None: - var required_annotation = flag.annotations.get(REQUIRED, List[String]()) - if required_annotation: - if required_annotation[0] == "true" and not flag.changed: - missing_flag_names.append(flag.name) + if flag.required and not flag.changed: + missing_flag_names.append(flag.name) + # var required_annotation = flag.annotations.get(REQUIRED, List[String]()) + # if required_annotation: + # if required_annotation[0] == "true" and not flag.changed: + # missing_flag_names.append(flag.name) - flags.visit_all[check_required_flag]() + visit_all[check_required_flag](flags) if len(missing_flag_names) > 0: raise Error("Required flag(s): " + missing_flag_names.__str__() + " not set.") +fn lookup(ref flags: List[Flag], name: String, type: String = "") raises -> Pointer[Flag, __origin_of(flags)]: + """Returns an mutable or immutable Pointer to a Flag with the given name. + Mutable if FlagSet is mutable, immutable if FlagSet is immutable. + + Args: + flags: The flags to lookup. + name: The name of the Flag to lookup. + type: The type of the Flag to lookup. + + Returns: + Optional Pointer to the Flag. + + Raises: + Error: If the Flag is not found. + """ + if type == "": + for i in range(len(flags)): + if flags[i].name == name: + return Pointer.address_of(flags[i]) + else: + for i in range(len(flags)): + if flags[i].name == name and flags[i].type == type: + return Pointer.address_of(flags[i]) + + raise Error("FlagNotFoundError: Could not find the following flag: " + name) + + +fn lookup_name(flags: List[Flag], shorthand: String) raises -> String: + """Returns the name of a flag given its shorthand. + + Args: + flags: The flags to lookup. + shorthand: The shorthand of the flag to lookup. + + Returns: + The name of the flag. + + Raises: + Error: If the flag is not found. + """ + for flag in flags: + if flag[].shorthand and flag[].shorthand == shorthand: + return flag[].name + + raise Error("FlagNotFoundError: Could not find the following flag shorthand: " + shorthand) + + fn string_flag( name: String, usage: String, @@ -1208,9 +373,11 @@ fn string_flag( environment_variable: Optional[StringLiteral] = None, file_path: Optional[StringLiteral] = None, action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, ) -> Flag: """Adds a `String` flag to the flag set. - + Args: name: The name of the flag. usage: The usage of the flag. @@ -1219,8 +386,11 @@ fn string_flag( environment_variable: The environment variable to check for a value. file_path: The file to check for a value. action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. """ - return Flag(name=name, + return Flag( + name=name, shorthand=shorthand, usage=usage, default=str(default), @@ -1228,4 +398,652 @@ fn string_flag( environment_variable=environment_variable, file_path=file_path, action=action, - ) \ No newline at end of file + required=required, + persistent=persistent, + ) + + +fn bool_flag( + name: String, + usage: String, + shorthand: String = "", + default: Bool = False, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Bool` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Bool", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int8_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int8 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int8` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int8", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int16_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int16 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int16", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int32_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int32 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int32", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int64_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int64 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int64", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt8 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint8_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt8 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt8` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt8", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint16_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt16 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt16", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint32_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt32 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt32", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint64_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt64 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt64", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn float16_flag( + name: String, + usage: String, + shorthand: String = "", + default: Float16 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Float16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Float16", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn float32_flag( + name: String, + usage: String, + shorthand: String = "", + default: Float32 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Float32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Float32", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn float64_flag( + name: String, + usage: String, + shorthand: String = "", + default: Float64 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Float64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Float64", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn string_list_flag( + name: String, + usage: String, + shorthand: String = "", + default: List[String] = List[String](), + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `StringList` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=" ".join(default), + type="StringList", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int_list_flag( + name: String, + usage: String, + shorthand: String = "", + default: List[Int, True] = List[Int, True](), + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `IntList` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=" ".join(default), + type="IntList", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn float64_list_flag( + name: String, + usage: String, + shorthand: String = "", + default: List[Float64, True] = List[Float64, True](), + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Float64List` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=" ".join(default), + type="Float64List", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) diff --git a/src/prism/util.mojo b/src/prism/util.mojo index a5f1ea8..68d5d8c 100644 --- a/src/prism/util.mojo +++ b/src/prism/util.mojo @@ -1,5 +1,5 @@ from collections import InlineList -from memory import ArcPointerPointer +from memory import ArcPointer fn split(text: String, sep: String, max_split: Int = -1) -> List[String]: @@ -9,7 +9,7 @@ fn split(text: String, sep: String, max_split: Int = -1) -> List[String]: text: The string to split. sep: The separator to split the string by. max_split: The maximum number of splits to perform. - + Returns: The list of substrings. """ @@ -39,7 +39,7 @@ fn to_string[T: StringableCollectionElement](vector: List[ArcPointer[T]]) -> Str Args: vector: The vector to convert to a string. - + Returns: The string representation of the vector. """ @@ -58,7 +58,7 @@ fn to_list(flag_names: VariadicListMem[String, _]) -> List[String]: Args: flag_names: The variadic list to convert to a list. - + Returns: The list representation of the variadic list. """ From 7b2b08c133c84a8749915a927f75df5fe8c25b7c Mon Sep 17 00:00:00 2001 From: Mikhail Tavarez Date: Thu, 2 Jan 2025 10:39:24 -0600 Subject: [PATCH 4/7] clean up tests --- README.md | 8 +- examples/aliases.mojo | 17 ++- examples/alt_flag_values.mojo | 29 +++-- examples/arg_validators.mojo | 44 +++---- examples/chromeria.mojo | 7 +- examples/fg_child.mojo | 20 +-- examples/fg_parent.mojo | 39 ++++-- examples/flag_action.mojo | 2 +- examples/hello_world.mojo | 56 ++++----- examples/list_flags.mojo | 88 +++++++------ examples/printer/mojoproject.toml | 6 +- examples/printer/printer.mojo | 25 ++-- examples/requests/mojoproject.toml | 4 +- examples/requests/nested.mojo | 65 ++++++---- examples/requests/persistent_flags.mojo | 82 +++++++------ scripts/check-docstrings.py | 27 ++++ scripts/examples.sh | 62 ++++++++++ src/prism/args.mojo | 23 ++-- src/prism/command.mojo | 156 +++++++++++++----------- src/prism/flag_group.mojo | 10 +- src/prism/flag_parser.mojo | 2 +- src/prism/flag_set.mojo | 132 -------------------- src/prism/util.mojo | 14 ++- test/test_args.mojo | 47 ++++--- test/test_command.mojo | 26 ++-- test/test_flags.mojo | 63 +++++++--- 26 files changed, 556 insertions(+), 498 deletions(-) create mode 100644 scripts/check-docstrings.py create mode 100644 scripts/examples.sh diff --git a/README.md b/README.md index 28858ea..0bc225e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Budding CLI Library! -Inspired by: `Cobra`! +Inspired by: `Cobra` and `urfave/cli`! ![Mojo Version](https://img.shields.io/badge/Mojo%F0%9F%94%A5-24.5-orange) ![Build Status](https://github.com/thatstoasty/prism/actions/workflows/build.yml/badge.svg) @@ -375,11 +375,15 @@ fn main() -> None: - Enable usage function to return the results of a usage function upon calling wrong functions or commands. - Replace print usage with writers to enable stdout/stderr/file writing. - Update default help command to improve available commands and flags section. +- Add support for combining shorthand flags, like so: `-abc` instead of `-a -b -c`. +- Try to avoid `Dict` and `try/except` blocks in order to support compile time command building. +- Add persistent flag mutually exclusive and required together checks back in. ## Improvements - Tree traversal improvements. -- `Arc[Command]` being passed to validators and command functions is marked as inout because the compiler complains about forming a reference to a borrowed register value. This is a temporary fix, I will try to get it back to a borrowed reference. +- `ArcPointer[Command]` being passed to validators and command functions is marked as inout because the compiler complains about forming a reference to a borrowed register value. This is a temporary fix, I will try to get it back to a borrowed reference. - For now, help functions and arg validators will need to be set after the command is constructed. This is to help reduce cyclical dependencies, but I will work on a way to set these values in the constructor as the type system matures. +- Once we have trait objects, use actual typed flags instead of converting values to and from strings. ## Bugs diff --git a/examples/aliases.mojo b/examples/aliases.mojo index b95d269..0af0423 100644 --- a/examples/aliases.mojo +++ b/examples/aliases.mojo @@ -15,11 +15,16 @@ fn main() -> None: name="my", usage="This is a dummy command!", run=test, + children=List[ArcPointer[Command]]( + ArcPointer( + Command( + name="tool", + usage="This is a dummy command!", + run=tool_func, + aliases=List[String]("object", "thing") + ) + ) + ), ) - - var print_tool = Arc( - Command(name="tool", usage="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing")) - ) - - root.add_subcommand(print_tool) + root.execute() diff --git a/examples/alt_flag_values.mojo b/examples/alt_flag_values.mojo index b146c79..7dfdc79 100644 --- a/examples/alt_flag_values.mojo +++ b/examples/alt_flag_values.mojo @@ -1,26 +1,31 @@ from memory import ArcPointer -from prism import Command, Context +from prism import Command, Context, Flag +import prism +import os fn test(ctx: Context) raises -> None: - name = ctx.command[].flags.get_string("name") - print(String("Hello {}").format(name)) + name = ctx.command[].get_string("name") + print("Hello {}".format(name)) fn main() -> None: + _ = os.setenv("NAME", "Mikhail") root = Command( name="greet", usage="Greet a user!", raising_run=test, - ) - - root.flags.string_flag( - name="name", - shorthand="n", - usage="The name of the person to greet.", - environment_variable="NAME", - file_path="~/.myapp/config", - default="World", + flags=List[Flag]( + prism.string_flag( + name="name", + shorthand="n", + usage="The name of the person to greet.", + environment_variable="NAME", + file_path="~/.myapp/config", + default="World", + ) + ), ) root.execute() + _ = os.unsetenv("NAME") diff --git a/examples/arg_validators.mojo b/examples/arg_validators.mojo index 1ba80fe..c54afee 100644 --- a/examples/arg_validators.mojo +++ b/examples/arg_validators.mojo @@ -21,36 +21,28 @@ fn hello(ctx: Context) -> None: fn main() -> None: + var no_args_command = ArcPointer(Command(name="no_args", usage="This is a dummy command!", run=hello, arg_validator=no_args)) + + var valid_args_command = ArcPointer( + Command(name="valid_args", usage="This is a dummy command!", run=hello, valid_args=List[String]("Pineapple"), arg_validator=valid_args) + ) + var minimum_n_args_command = ArcPointer(Command(name="minimum_n_args", usage="This is a dummy command!", run=hello, arg_validator=minimum_n_args[4]())) + var maximum_n_args_command = ArcPointer(Command(name="maximum_n_args", usage="This is a dummy command!", run=hello, arg_validator=maximum_n_args[1]())) + var exact_args_command = ArcPointer(Command(name="exact_args", usage="This is a dummy command!", run=hello, arg_validator=exact_args[1]())) + var range_args_command = ArcPointer(Command(name="range_args", usage="This is a dummy command!", run=hello, arg_validator=range_args[0, 1]())) + var root = Command( name="hello", usage="This is a dummy command!", run=test, + children=List[ArcPointer[Command]]( + no_args_command, + valid_args_command, + minimum_n_args_command, + maximum_n_args_command, + exact_args_command, + range_args_command, + ), ) - var no_args_command = Arc(Command(name="no_args", usage="This is a dummy command!", run=hello)) - no_args_command[].arg_validator = no_args - - var valid_args_command = Arc( - Command(name="valid_args", usage="This is a dummy command!", run=hello, valid_args=List[String]("Pineapple")) - ) - valid_args_command[].arg_validator = valid_args - - var minimum_n_args_command = Arc(Command(name="minimum_n_args", usage="This is a dummy command!", run=hello)) - minimum_n_args_command[].arg_validator = minimum_n_args[4]() - - var maximum_n_args_command = Arc(Command(name="maximum_n_args", usage="This is a dummy command!", run=hello)) - maximum_n_args_command[].arg_validator = maximum_n_args[1]() - - var exact_args_command = Arc(Command(name="exact_args", usage="This is a dummy command!", run=hello)) - exact_args_command[].arg_validator = exact_args[1]() - - var range_args_command = Arc(Command(name="range_args", usage="This is a dummy command!", run=hello)) - range_args_command[].arg_validator = range_args[0, 1]() - - root.add_subcommand(no_args_command) - root.add_subcommand(valid_args_command) - root.add_subcommand(minimum_n_args_command) - root.add_subcommand(maximum_n_args_command) - root.add_subcommand(exact_args_command) - root.add_subcommand(range_args_command) root.execute() diff --git a/examples/chromeria.mojo b/examples/chromeria.mojo index b6684a5..507e4bd 100644 --- a/examples/chromeria.mojo +++ b/examples/chromeria.mojo @@ -16,13 +16,8 @@ fn main() -> None: usage="This is a dummy command!", run=test, children=List[ArcPointer[Command]]( - ArcPointer(Command( - name="chromeria", usage="This is a dummy command!", run=hello - )) + ArcPointer(Command(name="chromeria", usage="This is a dummy command!", run=hello)) ), ) - # var hello_command = ArcPointer(Command(name="chromeria", usage="This is a dummy command!", run=hello)) - - # root.add_subcommand(hello_command) root.execute() diff --git a/examples/fg_child.mojo b/examples/fg_child.mojo index 5b9a9c8..ba31007 100644 --- a/examples/fg_child.mojo +++ b/examples/fg_child.mojo @@ -22,16 +22,19 @@ fn main() -> None: shorthand="r", usage="Always required.", required=True, + persistent=True, ), prism.string_flag( name="host", shorthand="h", usage="Host", + persistent=True, ), prism.string_flag( name="port", shorthand="p", usage="Port", + persistent=True, ), ), children=List[ArcPointer[Command]]( @@ -53,24 +56,11 @@ fn main() -> None: usage="URI", ), ), + # mutally_exclusive_flags=List[String]("host", "uri"), + # flags_required_together=List[String]("host", "port"), ) ) ), ) - # root.persistent_flags.bool_flag(name="required", shorthand="r", usage="Always required.") - # root.persistent_flags.string_flag(name="host", shorthand="h", usage="Host") - # root.persistent_flags.string_flag(name="port", shorthand="p", usage="Port") - # root.mark_persistent_flag_required("required") - - # var print_tool = ArcPointer(Command(name="tool", usage="This is a dummy command!", run=tool_func)) - # print_tool[].flags.bool_flag(name="also", shorthand="a", usage="Also always required.") - # print_tool[].flags.string_flag(name="uri", shorthand="u", usage="URI") - # root.add_subcommand(print_tool) - - # Make sure to add the child command to the parent before marking flags. - # add_subcommand() will merge persistent flags from the parent into the child's flags. - # print_tool[].mark_flag_required("also") - # print_tool[].mark_flags_required_together("host", "port") - # print_tool[].mark_flags_mutually_exclusive("host", "uri") root.execute() diff --git a/examples/fg_parent.mojo b/examples/fg_parent.mojo index e3ee995..ca683cb 100644 --- a/examples/fg_parent.mojo +++ b/examples/fg_parent.mojo @@ -1,11 +1,12 @@ from memory import ArcPointer from prism import Command, Context +import prism fn test(ctx: Context) raises -> None: - var host = ctx.command[].flags.get_string("host") - var port = ctx.command[].flags.get_string("port") - var uri = ctx.command[].flags.get_string("uri") + var host = ctx.command[].get_string("host") + var port = ctx.command[].get_string("port") + var uri = ctx.command[].get_string("uri") if uri != "": print("URI:", uri) @@ -22,13 +23,31 @@ fn main() -> None: name="my", usage="This is a dummy command!", raising_run=test, + flags=List[prism.Flag]( + prism.bool_flag( + name="required", + shorthand="r", + usage="Always required.", + required=True, + ), + prism.string_flag( + name="host", + shorthand="h", + usage="Host", + ), + prism.string_flag( + name="port", + shorthand="p", + usage="Port", + ), + prism.string_flag( + name="uri", + shorthand="u", + usage="URI", + ), + ), + mutually_exclusive_flags=List[String]("host", "uri"), + flags_required_together=List[String]("host", "port"), ) - root.persistent_flags.bool_flag(name="required", shorthand="r", usage="Always required.") - root.persistent_flags.string_flag(name="host", shorthand="h", usage="Host") - root.persistent_flags.string_flag(name="port", shorthand="p", usage="Port") - root.persistent_flags.string_flag(name="uri", shorthand="u", usage="URI") - root.mark_flags_required_together("host", "port") - root.mark_flags_mutually_exclusive("host", "uri") - root.mark_flag_required("required") root.execute() diff --git a/examples/flag_action.mojo b/examples/flag_action.mojo index 50b7066..4c4ccaa 100644 --- a/examples/flag_action.mojo +++ b/examples/flag_action.mojo @@ -26,7 +26,7 @@ fn main() -> None: default="World", action=validate_name, ) - ) + ), ) root.execute() diff --git a/examples/hello_world.mojo b/examples/hello_world.mojo index ec95a99..2dc9a75 100644 --- a/examples/hello_world.mojo +++ b/examples/hello_world.mojo @@ -1,5 +1,6 @@ from memory import ArcPointer -from prism import Command, Context +from prism import Command, Context, Flag +import prism fn printer(ctx: Context) -> None: @@ -24,28 +25,14 @@ fn build_printer_command() -> ArcPointer[Command]: fn say(ctx: Context) -> None: print("Shouldn't be here!") - return None fn say_hello(ctx: Context) -> None: print("Hello World!") - return None fn say_goodbye(ctx: Context) -> None: print("Goodbye World!") - return None - - -# for some reason returning the command object without setting it to variable breaks the compiler -fn build_say_command() -> ArcPointer[Command]: - return ArcPointer( - Command( - name="say", - usage="Say something to someone", - run=say, - ) - ) fn build_hello_command() -> ArcPointer[Command]: @@ -72,10 +59,10 @@ fn build_goodbye_command() -> ArcPointer[Command]: fn test(ctx: Context) -> None: try: - print(ctx.command[].flags.get_string("env")) + print(ctx.command[].get_string("env")) except: print("No env flag provided.") - for item in ctx.command[].flags.flags: + for item in ctx.command[].flags: if item[].value: print(item[].name, item[].value.value()) else: @@ -85,21 +72,34 @@ fn test(ctx: Context) -> None: fn main() -> None: + var hello_command = build_hello_command() + var goodbye_command = build_goodbye_command() + var printer_command = build_printer_command() + var root = Command( name="tones", usage="This is a dummy command!", run=test, + flags=List[Flag]( + prism.string_flag( + name="env", + shorthand="e", + usage="Environment.", + default="", + ) + ), + children=List[ArcPointer[Command]]( + ArcPointer(Command( + name="say", + usage="Say something to someone", + run=say, + children=List[ArcPointer[Command]]( + hello_command, + goodbye_command, + ), + )), + printer_command, + ), ) - root.flags.string_flag(name="env", shorthand="e", usage="Environment.", default="") - - var say_command = build_say_command() - var hello_command = build_hello_command() - var goodbye_command = build_goodbye_command() - var printer_command = build_printer_command() - - say_command[].add_subcommand(goodbye_command) - say_command[].add_subcommand(hello_command) - root.add_subcommand(say_command) - root.add_subcommand(printer_command) root.execute() diff --git a/examples/list_flags.mojo b/examples/list_flags.mojo index 467d9df..a5e5f1f 100644 --- a/examples/list_flags.mojo +++ b/examples/list_flags.mojo @@ -1,26 +1,27 @@ from memory import ArcPointer -from prism import Command, Context +from prism import Command, Context, Flag +import prism fn test(ctx: Context) raises -> None: - name = ctx.command[].flags.get_string_list("name") - print(String("Hello {}").format(" ".join(name))) + name = ctx.command[].get_string_list("name") + print("Hello {}".format(" ".join(name))) fn sum(ctx: Context) raises -> None: - numbers = ctx.command[].flags.get_int_list("number") + numbers = ctx.command[].get_int_list("number") sum = 0 for number in numbers: sum += number[] - print(String("The sum is: {}").format(sum)) + print("The sum is: {}".format(sum)) fn sum_float(ctx: Context) raises -> None: - numbers = ctx.command[].flags.get_float64_list("number") + numbers = ctx.command[].get_float64_list("number") sum = 0.0 for number in numbers: sum += number[] - print(String("The sum is: {}").format(sum)) + print("The sum is: {}".format(sum)) fn main() -> None: @@ -28,39 +29,46 @@ fn main() -> None: name="greet", usage="Greet a user!", raising_run=test, - ) - - root.flags.string_list_flag( - name="name", - shorthand="n", - usage="The name of the person to greet.", - default=List[String]("Mikhail", "Tavarez"), - ) - - sum_cmd = Arc(Command( - name="sum", - usage="Add up the numbers passed in with the -n flag!", - raising_run=sum - )) - root.add_subcommand(sum_cmd) - - sum_cmd[].flags.int_list_flag( - name="number", - shorthand="n", - usage="A number to include in the sum.", - default=List[Int, True](1, 2), - ) - - sum_float_cmd = Arc( - Command(name="sum_float", usage="Add up the numbers passed in with the -n flag!", raising_run=sum_float) - ) - root.add_subcommand(sum_float_cmd) - - sum_float_cmd[].flags.float64_list_flag( - name="number", - shorthand="n", - usage="A number to include in the sum.", - default=List[Float64, True](1, 2), + flags=List[Flag]( + prism.string_list_flag( + name="name", + shorthand="n", + usage="The name of the person to greet.", + default=List[String]("Mikhail", "Tavarez") + ) + ), + children=List[ArcPointer[Command]]( + ArcPointer( + Command( + name="sum", + usage="Add up the numbers passed in with the -n flag!", + raising_run=sum, + flags=List[Flag]( + prism.int_list_flag( + name="number", + shorthand="n", + usage="A number to include in the sum.", + default=List[Int, True](1, 2) + ) + ) + ) + ), + ArcPointer( + Command( + name="sum_float", + usage="Add up the numbers passed in with the -n flag!", + raising_run=sum_float, + flags=List[Flag]( + prism.float64_list_flag( + name="number", + shorthand="n", + usage="A number to include in the sum.", + default=List[Float64, True](1, 2) + ) + ) + ) + ) + ) ) root.execute() diff --git a/examples/printer/mojoproject.toml b/examples/printer/mojoproject.toml index ee293a1..48b95e9 100644 --- a/examples/printer/mojoproject.toml +++ b/examples/printer/mojoproject.toml @@ -9,6 +9,6 @@ version = "0.1.0" [tasks] [dependencies] -max = ">=24.5.0,<25" -mist = ">=0.1.8,<0.2" -prism = ">=0.2.0,<0.2" +max = ">=24.6.0" +mist = ">=0.1.9" +prism = ">=0.2.2" diff --git a/examples/printer/printer.mojo b/examples/printer/printer.mojo index e75f007..832de90 100644 --- a/examples/printer/printer.mojo +++ b/examples/printer/printer.mojo @@ -1,5 +1,6 @@ from memory import ArcPointer -from prism import Command, Context, exact_args +from prism import Command, Context, exact_args, Flag +import prism import mist @@ -8,8 +9,8 @@ fn printer(ctx: Context) raises -> None: print("No text to print! Pass in some text as a positional argument.") return None - var color = ctx.command[].flags.get_uint32("color") - var formatting = ctx.command[].flags.get_string("formatting") + var color = ctx.command[].get_uint32("color") + var formatting = ctx.command[].get_string("formatting") var style = mist.Style().foreground(color) if formatting == "": @@ -44,10 +45,20 @@ fn main() -> None: raising_run=printer, pre_run=pre_hook, post_run=post_hook, + arg_validator=exact_args[1](), + flags=List[Flag]( + prism.uint32_flag( + name="color", + shorthand="c", + usage="Text color", + default=0x3464EB + ), + prism.string_flag( + name="formatting", + shorthand="f", + usage="Text formatting" + ) + ) ) - root.arg_validator = exact_args[1]() - - root.flags.uint32_flag(name="color", shorthand="c", usage="Text color", default=0x3464EB) - root.flags.string_flag(name="formatting", shorthand="f", usage="Text formatting") root.execute() diff --git a/examples/requests/mojoproject.toml b/examples/requests/mojoproject.toml index 4bc55b8..542fb8d 100644 --- a/examples/requests/mojoproject.toml +++ b/examples/requests/mojoproject.toml @@ -9,6 +9,6 @@ version = "0.1.0" [tasks] [dependencies] -max = ">=24.5.0,<25" -prism = ">=0.2.0,<0.2" +max = ">=24.6.0" +prism = ">=0.2.2" requests = ">=2.32.3,<3" diff --git a/examples/requests/nested.mojo b/examples/requests/nested.mojo index 608a22b..d72905d 100644 --- a/examples/requests/nested.mojo +++ b/examples/requests/nested.mojo @@ -1,5 +1,6 @@ from memory import ArcPointer -from prism import Command, Context +from prism import Command, Context, Flag +import prism from python import Python @@ -14,8 +15,7 @@ fn print_information(ctx: Context) -> None: fn get_cat_fact(ctx: Context) raises -> None: - var flags = ctx.command[].flags - var lover = flags.get_bool("lover") + var lover = ctx.command[].get_bool("lover") if lover: print("Hello fellow cat lover!") @@ -25,7 +25,7 @@ fn get_cat_fact(ctx: Context) raises -> None: var url = "https://catfact.ninja/fact" # Send the GET requests - var count = flags.get_int("count") + var count = ctx.command[].get_int("count") if not count: raise Error("Count flag was not found.") @@ -57,35 +57,46 @@ fn get_dog_breeds(ctx: Context) raises -> None: fn main() -> None: - var root = Command(name="nested", usage="Base command.", run=base) - - var get_command = Arc( - Command( - name="get", - usage="Base command for getting some data.", - run=print_information, - ) - ) - - var cat_command = Arc( - Command( + var cat_command = Command( name="cat", usage="Get some cat facts!", raising_run=get_cat_fact, + flags=List[Flag]( + prism.int_flag( + name="count", + shorthand="c", + usage="Number of facts to get.", + default=1 + ), + prism.bool_flag( + name="lover", + shorthand="l", + usage="Are you a cat lover?" + ) + ) ) + + var dog_command = Command( + name="dog", + usage="Get some dog breeds!", + raising_run=get_dog_breeds, ) - cat_command[].flags.int_flag(name="count", shorthand="c", usage="Number of facts to get.", default=1) - cat_command[].flags.bool_flag(name="lover", shorthand="l", usage="Are you a cat lover?") - - var dog_command = Arc( - Command( - name="dog", - usage="Get some dog breeds!", - raising_run=get_dog_breeds, + + var root = Command( + name="nested", + usage="Base command.", + run=base, + children=List[ArcPointer[Command]]( + Command( + name="get", + usage="Base command for getting some data.", + run=print_information, + children=List[ArcPointer[Command]]( + cat_command, + dog_command + ) + ) ) ) - get_command[].add_subcommand(cat_command) - get_command[].add_subcommand(dog_command) - root.add_subcommand(get_command) root.execute() diff --git a/examples/requests/persistent_flags.mojo b/examples/requests/persistent_flags.mojo index b1222a6..ba1481f 100644 --- a/examples/requests/persistent_flags.mojo +++ b/examples/requests/persistent_flags.mojo @@ -1,5 +1,6 @@ from memory import ArcPointer -from prism import Command, Context +from prism import Command, Context, Flag +import prism from python import Python @@ -14,8 +15,7 @@ fn print_information(ctx: Context) -> None: fn get_cat_fact(ctx: Context) raises -> None: - var flags = ctx.command[].flags - var lover = flags.get_bool("lover") + var lover = ctx.command[].get_bool("lover") if lover: print("Hello fellow cat lover!") @@ -25,7 +25,7 @@ fn get_cat_fact(ctx: Context) raises -> None: var url = "https://catfact.ninja/fact" # Send the GET requests - var count = flags.get_int("count") + var count = ctx.command[].get_int("count") if not count: raise Error("Count flag was not found.") @@ -41,8 +41,7 @@ fn get_cat_fact(ctx: Context) raises -> None: fn get_dog_breeds(ctx: Context) raises -> None: - var flags = ctx.command[].flags - var lover = flags.get_bool("lover") + var lover = ctx.command[].get_bool("lover") if lover: print("Hello fellow dog lover!") @@ -69,37 +68,52 @@ fn post_hook(ctx: Context) -> None: fn main() -> None: - var root = Command(name="nested", usage="Base command.", run=base) - - var get_command = Arc( - Command( - name="get", - usage="Base command for getting some data.", - run=print_information, - persistent_pre_run=pre_hook, - persistent_post_run=post_hook, + var cat_command = ArcPointer(Command( + name="cat", + usage="Get some cat facts!", + raising_run=get_cat_fact, + flags=List[Flag]( + prism.int_flag( + name="count", + shorthand="c", + usage="Number of facts to get.", + ) ) - ) - get_command[].persistent_flags.bool_flag(name="lover", shorthand="l", usage="Are you an animal lover?") - - var cat_command = Arc( - Command( - name="cat", - usage="Get some cat facts!", - raising_run=get_cat_fact, + )) + + var dog_command = ArcPointer(Command( + name="dog", + usage="Get some dog breeds!", + raising_run=get_dog_breeds, + )) + + var get_command = ArcPointer(Command( + name="get", + usage="Base command for getting some data.", + run=print_information, + persistent_pre_run=pre_hook, + persistent_post_run=post_hook, + flags=List[Flag]( + prism.bool_flag( + name="lover", + shorthand="l", + usage="Are you an animal lover?", + persistent=True, + ) + ), + children=List[ArcPointer[Command]]( + cat_command, + dog_command ) - ) - cat_command[].flags.int_flag(name="count", shorthand="c", usage="Number of facts to get.") - - var dog_command = Arc( - Command( - name="dog", - usage="Get some dog breeds!", - raising_run=get_dog_breeds, + )) + + var root = Command( + name="nested", + usage="Base command.", + run=base, + children=List[ArcPointer[Command]]( + get_command ) ) - get_command[].add_subcommand(cat_command) - get_command[].add_subcommand(dog_command) - root.add_subcommand(get_command) root.execute() diff --git a/scripts/check-docstrings.py b/scripts/check-docstrings.py new file mode 100644 index 0000000..2bbc66c --- /dev/null +++ b/scripts/check-docstrings.py @@ -0,0 +1,27 @@ +import subprocess +import sys + +# TODO: Use the "mojo doc" directly when there is an option to +# fail if warnings are present (something like -Werror for gcc). + + +def main(): + # This is actually faster than running "mojo doc" on each file since + # "mojo doc" only accept a single file/path as argument + command = [ + "mojo", + "doc", + "--diagnose-missing-doc-strings", + "-o", + "/dev/null", + "./src/prism", + ] + result = subprocess.run(command, capture_output=True) + if result.stderr or result.returncode != 0: + print("Docstring issue found: ") + print(result.stderr.decode()) + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/scripts/examples.sh b/scripts/examples.sh new file mode 100644 index 0000000..49d52df --- /dev/null +++ b/scripts/examples.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +TEMP_DIR=~/tmp +PACKAGE_NAME=prism +mkdir -p $TEMP_DIR + +echo "[INFO] Building $PACKAGE_NAME package and example binaries." +magic run mojo package src/$PACKAGE_NAME -o $TEMP_DIR/$PACKAGE_NAME.mojopkg +cp -a examples/. $TEMP_DIR +magic run mojo build $TEMP_DIR/aliases.mojo -o $TEMP_DIR/aliases +magic run mojo build $TEMP_DIR/hello_world.mojo -o $TEMP_DIR/hello_world +magic run mojo build $TEMP_DIR/fg_parent.mojo -o $TEMP_DIR/parent +magic run mojo build $TEMP_DIR/fg_child.mojo -o $TEMP_DIR/child +magic run mojo build $TEMP_DIR/arg_validators.mojo -o $TEMP_DIR/validators +magic run mojo build $TEMP_DIR/alt_flag_values.mojo -o $TEMP_DIR/alt_flag_values +magic run mojo build $TEMP_DIR/flag_action.mojo -o $TEMP_DIR/flag_action +magic run mojo build $TEMP_DIR/list_flags.mojo -o $TEMP_DIR/list_flags + +echo "[INFO] Running examples..." +# Need to run these first examples as part of a mojo project as they have external dependencies. +# printer is a portable binary, but nested and persistent_flags are not because they depend on a python library. +# cd examples/printer +# magic run mojo build printer.mojo +# ./printer "sample-text" --formatting=underline + +# cd ../requests +# magic run mojo build nested.mojo +# magic run nested get cat --count 3 -l +# magic run mojo build persistent_flags.mojo -o persistent +# magic run persistent get cat --count 2 --lover +# magic run persistent get dog + +cd ../.. + +$TEMP_DIR/aliases my thing +$TEMP_DIR/hello_world say hello +$TEMP_DIR/parent --required --host=www.example.com --port 8080 +$TEMP_DIR/parent --required --host www.example.com +$TEMP_DIR/parent --required --host www.example.com --uri abcdef --port 8080 +$TEMP_DIR/parent +$TEMP_DIR/child tool --required -a --host=www.example.com --port 8080 +$TEMP_DIR/child tool --required -a --host www.example.com +$TEMP_DIR/child tool --required --also --host www.example.com --uri abcdef --port 8080 +$TEMP_DIR/validators Hello from Mojo! +$TEMP_DIR/validators no_args Hello from Mojo! +$TEMP_DIR/validators valid_args Hello from Mojo! +$TEMP_DIR/validators minimum_n_args Hello from Mojo! +$TEMP_DIR/validators maximum_n_args Hello from Mojo! +$TEMP_DIR/validators exact_args Hello from Mojo! +$TEMP_DIR/validators range_args Hello from Mojo! +$TEMP_DIR/alt_flag_values -n Mojo +$TEMP_DIR/alt_flag_values +$TEMP_DIR/flag_action +$TEMP_DIR/flag_action -n Mojo +$TEMP_DIR/list_flags +$TEMP_DIR/list_flags -n My -n Mojo +$TEMP_DIR/list_flags sum -n 1 -n 2 -n 3 -n 4 -n 5 +$TEMP_DIR/list_flags sum_float -n 1.2 -n 2.3 -n 3.4 -n 4.5 -n 5.6 + + +echo "[INFO] Cleaning up the example directory." +rm -R $TEMP_DIR \ No newline at end of file diff --git a/src/prism/args.mojo b/src/prism/args.mojo index e2cbe77..d20e871 100644 --- a/src/prism/args.mojo +++ b/src/prism/args.mojo @@ -131,21 +131,22 @@ fn range_args[minimum: Int, maximum: Int]() -> ArgValidatorFn: # TODO: Having some issues with varadic list of functions, so using List for now. # Broken until alias list of functions is fixed. Pointer to function incorrectly points to 0x0. -# fn match_all[arg_validators: List[ArgValidatorFn]]() -> ArgValidatorFn: -# """Returns an error if any of the arg_validators return an error. +fn match_all[*arg_validators: ArgValidatorFn]() -> ArgValidatorFn: + """Returns an error if any of the arg_validators return an error. -# Parameters: -# arg_validators: A list of ArgValidatorFn functions that check the arguments. + Parameters: + arg_validators: A list of ArgValidatorFn functions that check the arguments. -# Returns: -# A function that checks all the arguments using the arg_validators list.. -# """ + Returns: + A function that checks all the arguments using the arg_validators list.. + """ -# fn match_all_args(ctx: Context) raises -> None: -# for i in range(len(arg_validators)): -# arg_validators[i](ctx) + fn match_all_args(ctx: Context) raises -> None: + alias validators = VariadicList(arg_validators) + for validator in validators: + validator(ctx) -# return match_all_args + return match_all_args fn get_args(arguments: List[String]) -> List[String]: diff --git a/src/prism/command.mojo b/src/prism/command.mojo index 656dab4..6c55369 100644 --- a/src/prism/command.mojo +++ b/src/prism/command.mojo @@ -1,9 +1,8 @@ from sys import argv from collections import Optional, Dict, InlineList from memory import ArcPointer -from os import abort import mog -from .util import to_string, to_list, string_to_bool +from .util import to_string, to_list, string_to_bool, panic from .flag import Flag from .flag_set import ( visit_all, @@ -23,7 +22,7 @@ from .args import arbitrary_args, get_args from .context import Context -fn concat_names(flag_names: VariadicListMem[String, _]) -> String: +fn _concat_names(flag_names: VariadicListMem[String, _]) -> String: """Concatenates the flag names into a single string. Args: @@ -41,7 +40,25 @@ fn concat_names(flag_names: VariadicListMem[String, _]) -> String: return result -fn get_args_as_list() -> List[String]: +fn _concat_names(flag_names: List[String]) -> String: + """Concatenates the flag names into a single string. + + Args: + flag_names: The flag names to concatenate. + + Returns: + The concatenated flag names. + """ + var result = String() + for i in range(len(flag_names)): + result.write(flag_names[i]) + if i != len(flag_names) - 1: + result.write(" ") + + return result + + +fn _get_args_as_list() -> List[String]: """Returns the arguments passed to the executable as a list of strings. Returns: @@ -77,42 +94,40 @@ fn default_help(mut command: ArcPointer[Command]) raises -> String: var option_style = mog.Style().foreground(mog.Color(0x81C8BE)) var bold_style = mog.Style().bold() - var cmd = command var builder = String() builder.write(mog.Style().bold().foreground(mog.Color(0xE5C890)).render("Usage: ")) - builder.write(bold_style.render(cmd[].full_name())) + builder.write(bold_style.render(command[].full_name())) - if len(cmd[].flags) > 0: + if len(command[].flags) > 0: builder.write(" [OPTIONS]") - if len(cmd[].children) > 0: + if len(command[].children) > 0: builder.write(" COMMAND") builder.write(" [ARGS]...") - var usage = usage_style.render(mog.join_vertical(mog.left, builder, "\n", cmd[].usage)) + var usage = usage_style.render(mog.join_vertical(mog.left, builder, "\n", command[].usage)) builder = String() - if cmd[].flags: + if command[].flags: builder.write(bold_style.render("Options")) - for flag in cmd[].flags: + for flag in command[].flags: builder.write(option_style.render("\n-{}, --{}".format(flag[].shorthand, flag[].name))) builder.write(" {}".format(flag[].usage)) var options = border_style.render(builder) builder = String() - if cmd[].children: + if command[].children: builder.write(bold_style.render("Commands")) - for i in range(len(cmd[].children)): - builder.write("\n{} {}".format(option_style.render(cmd[].children[i][].name), cmd[].children[i][].usage)) + for i in range(len(command[].children)): + builder.write("\n{} {}".format(option_style.render(command[].children[i][].name), command[].children[i][].usage)) - if i == len(cmd[].children) - 1: + if i == len(command[].children) - 1: builder.write("\n") - if cmd[].aliases: + if command[].aliases: builder.write(bold_style.render("Aliases")) - builder.write("\n{}".format(option_style.render(cmd[].aliases.__str__()))) + builder.write("\n{}".format(option_style.render(command[].aliases.__str__()))) - var commands = border_style.render(builder) - return mog.join_vertical(mog.left, usage, options, commands) + return mog.join_vertical(mog.left, usage, options, border_style.render(builder)) alias CmdFn = fn (ctx: Context) -> None @@ -234,6 +249,9 @@ struct Command(CollectionElement, Writable, Stringable): persistent_raising_pre_run: Optional[RaisingCmdFn] = None, persistent_raising_post_run: Optional[RaisingCmdFn] = None, flags: List[Flag] = List[Flag](), + flags_required_together: Optional[List[String]] = None, + mutually_exclusive_flags: Optional[List[String]] = None, + arg_validator: Optional[ArgValidatorFn] = None, ): """Constructs a new `Command`. @@ -254,9 +272,12 @@ struct Command(CollectionElement, Writable, Stringable): persistent_raising_pre_run: The function to run before the command is executed that returns an error. This persists to children. persistent_raising_post_run: The function to run after the command is executed that returns an error. This persists to children. flags: The flags for the command. + flags_required_together: The flags that are required together. + mutually_exclusive_flags: The flags that are mutually exclusive. + arg_validator: The function to validate arguments passed to the command. """ if not run and not raising_run: - abort("A command must have a run or raising_run function.") + panic("A command must have a run or raising_run function.") self.name = name self.usage = usage @@ -277,17 +298,32 @@ struct Command(CollectionElement, Writable, Stringable): self.persistent_raising_pre_run = persistent_raising_pre_run self.persistent_raising_post_run = persistent_raising_post_run - self.arg_validator = arbitrary_args - self.valid_args = valid_args + if arg_validator: + self.arg_validator = arg_validator.value() + else: + self.arg_validator = arbitrary_args - self.children = children - self.parent = List[ArcPointer[Self]](capacity=1) + self.valid_args = valid_args - # These need to be mutable so we can add flags to them. self.flags = flags self.local_flags = List[Flag]() self.persistent_flags = List[Flag]() self._inherited_flags = List[Flag]() + + self.parent = List[ArcPointer[Self]](capacity=1) + self.children = children + for command in children: + if command[][].parent: + command[][].parent[0] = self + else: + command[][].parent.append(self) + + if flags_required_together: + self._mark_flags_required_together(flags_required_together.value()) + + if mutually_exclusive_flags: + self._mark_flags_mutually_exclusive(mutually_exclusive_flags.value()) + self.flags.append(bool_flag(name="help", shorthand="h", usage="Displays help information about the command.")) fn __moveinit__(mut self, owned existing: Self): @@ -334,7 +370,7 @@ struct Command(CollectionElement, Writable, Stringable): return String.write(self) fn write_to[W: Writer, //](self, mut writer: W): - """Write Flag string representation to a `Formatter`. + """Write Flag string representation to a `Writer`. Parameters: W: The type of writer to write to. @@ -521,7 +557,7 @@ struct Command(CollectionElement, Writable, Stringable): var root = self.root() return root[].execute() - command, remaining_args = self._parse_command_from_args(get_args_as_list()) + command, remaining_args = self._parse_command_from_args(_get_args_as_list()) # Merge local and inherited flags command._merge_flags() @@ -579,7 +615,7 @@ struct Command(CollectionElement, Writable, Stringable): command.raising_run.value()(ctx) self._execute_post_run_hooks(ctx, parents) except e: - abort(e) + panic(e) fn inherited_flags(self) -> List[Flag]: """Returns the flags for the command and inherited flags from its parent. @@ -594,8 +630,6 @@ struct Command(CollectionElement, Writable, Stringable): for flag in parent[].flags: if flag[].persistent: flags.append(flag[]) - # if parent[].persistent_flags: - # flags += parent[].persistent_flags self.visit_parents[add_parent_persistent_flags]() return flags @@ -606,31 +640,19 @@ struct Command(CollectionElement, Writable, Stringable): self._inherited_flags = self.inherited_flags() self.flags += self._inherited_flags - fn add_subcommand(mut self, mut command: ArcPointer[Self]): - """Adds child command and set's child's parent attribute to self. - - Args: - command: The command to add as a child of self. - """ - self.children.append(command) - if command[].parent: - command[].parent[0] = self - else: - command[].parent.append(self) - - # fn mark_flag_required(mut self, flag_name: String) -> None: - # """Marks the given flag with annotations so that `Prism` errors - # if the command is invoked without the flag. + # fn add_subcommand(mut self, mut command: ArcPointer[Self]): + # """Adds child command and set's child's parent attribute to self. # Args: - # flag_name: The name of the flag to mark as required. + # command: The command to add as a child of self. # """ - # try: - # self.flags.set_required(flag_name) - # except e: - # abort(e) - - fn mark_flags_required_together(mut self, *flag_names: String) -> None: + # self.children.append(command) + # if command[].parent: + # command[].parent[0] = self + # else: + # command[].parent.append(self) + + fn _mark_flags_required_together(mut self, flag_names: List[String]) -> None: """Marks the given flags with annotations so that `Prism` errors if the command is invoked with a subset (but not all) of the given flags. @@ -638,14 +660,14 @@ struct Command(CollectionElement, Writable, Stringable): flag_names: The names of the flags to mark as required together. """ self._merge_flags() - var names = concat_names(flag_names) + var names = _concat_names(flag_names) try: for flag_name in flag_names: set_as[REQUIRED_AS_GROUP](self.flags, flag_name[], names) except e: - abort(e) + panic(e) - fn mark_flags_one_required(mut self, *flag_names: String) -> None: + fn _mark_flags_one_required(mut self, *flag_names: String) -> None: """Marks the given flags with annotations so that `Prism` errors if the command is invoked without at least one flag from the given set of flags. @@ -653,14 +675,14 @@ struct Command(CollectionElement, Writable, Stringable): flag_names: The names of the flags to mark as required. """ self._merge_flags() - var names = concat_names(flag_names) + var names = _concat_names(flag_names) try: for flag_name in flag_names: set_as[ONE_REQUIRED](self.flags, flag_name[], names) except e: - abort(e) - - fn mark_flags_mutually_exclusive(mut self, *flag_names: String) -> None: + panic(e) + + fn _mark_flags_mutually_exclusive(mut self, flag_names: List[String]) -> None: """Marks the given flags with annotations so that `Prism` errors if the command is invoked with more than one flag from the given set of flags. @@ -668,24 +690,12 @@ struct Command(CollectionElement, Writable, Stringable): flag_names: The names of the flags to mark as mutually exclusive. """ self._merge_flags() - var names = concat_names(flag_names) + var names = _concat_names(flag_names) try: for flag_name in flag_names: set_as[MUTUALLY_EXCLUSIVE](self.flags, flag_name[], names) except e: - abort(e) - - # fn mark_persistent_flag_required(mut self, flag_name: String) -> None: - # """Marks the given persistent flag with annotations so that `Prism` errors - # if the command is invoked without the flag. - - # Args: - # flag_name: The name of the flag to mark as required. - # """ - # try: - # self.persistent_flags.set_required(flag_name) - # except e: - # abort(e) + panic(e) fn has_parent(self) -> Bool: """Returns True if the command has a parent, False otherwise. diff --git a/src/prism/flag_group.mojo b/src/prism/flag_group.mojo index ac70b70..0579d18 100644 --- a/src/prism/flag_group.mojo +++ b/src/prism/flag_group.mojo @@ -1,7 +1,9 @@ from collections import Dict -from os import abort + +# from os import panic from .flag import Flag from .flag_set import REQUIRED, REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE, visit_all +from .util import panic fn has_all_flags(flags: List[Flag], flag_names: List[String]) -> Bool: @@ -92,7 +94,7 @@ fn validate_required_flag_group(data: Dict[String, Dict[String, Bool]]) raises - for key in pair[].value.keys(): keys.append(key[]) - abort( + panic( "If any flags in the group, {}, are set they must all be set; missing {}.".format( keys.__str__(), unset.__str__(), @@ -126,7 +128,7 @@ fn validate_one_required_flag_group(data: Dict[String, Dict[String, Bool]]) rais for key in pair[].value.keys(): keys.append(key[]) - abort("At least one of the flags in the group {} is required.".format(keys.__str__())) + panic("At least one of the flags in the group {} is required.".format(keys.__str__())) fn validate_mutually_exclusive_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: @@ -155,7 +157,7 @@ fn validate_mutually_exclusive_flag_group(data: Dict[String, Dict[String, Bool]] for key in pair[].value.keys(): keys.append(key[]) - abort( + panic( "If any flags in the group {} are set none of the others can be; {} were all set.".format( keys.__str__(), set.__str__(), diff --git a/src/prism/flag_parser.mojo b/src/prism/flag_parser.mojo index ba0fa5f..c6ae35c 100644 --- a/src/prism/flag_parser.mojo +++ b/src/prism/flag_parser.mojo @@ -156,7 +156,7 @@ struct FlagParser: if not flag[].changed: flag[].set(value) else: - flag[].value.value().write(", ", value) + flag[].value.value().write(" ", value) else: flag[].set(value) self.index += increment_by diff --git a/src/prism/flag_set.mojo b/src/prism/flag_set.mojo index 73325a2..d2b0794 100644 --- a/src/prism/flag_set.mojo +++ b/src/prism/flag_set.mojo @@ -20,138 +20,6 @@ alias ONE_REQUIRED = "ONE_REQUIRED" alias MUTUALLY_EXCLUSIVE = "MUTUALLY_EXCLUSIVE" -# @value -# struct FlagSet(CollectionElement, Stringable, Sized, Boolable, EqualityComparable): -# """Represents a set of flags.""" - -# var flags: List[Flag] -# """The list of flags in the flag set.""" - -# fn __init__(mut self) -> None: -# """Initializes a new FlagSet.""" -# self.flags = List[Flag]() - -# fn __init__(mut self, other: FlagSet) -> None: -# """Initializes a new FlagSet from another FlagSet. - -# Args: -# other: The other FlagSet to copy from. -# """ -# self.flags = other.flags - -# fn __str__(self) -> String: -# """Returns a string representation of the FlagSet. - -# Returns: -# The string representation of the FlagSet. -# """ -# return String.write(self) - -# fn write_to[W: Writer, //](self, mut writer: W): -# """Write a string representation to a writer. - -# Parameters: -# W: The type of writer to write to. - -# Args: -# writer: The writer to write to. -# """ -# writer.write("FlagSet: [") -# for i in range(self.flags.size): -# writer.write(self.flags[i]) -# if i != self.flags.size - 1: -# writer.write(", ") -# writer.write("]") - -# fn __len__(self) -> Int: -# """Returns the number of flags in the flag set. - -# Returns: -# The number of flags in the flag set. -# """ -# return self.flags.size - -# fn __bool__(self) -> Bool: -# """Returns whether the flag set is empty. - -# Returns: -# Whether the flag set is empty. -# """ -# return self.flags.__bool__() - -# fn __contains__(self, value: Flag) -> Bool: -# """Returns whether the flag set contains a flag. - -# Args: -# value: The flag to check for. - -# Returns: -# Whether the flag set contains the flag. -# """ -# return value in self.flags - -# fn __eq__(self, other: Self) -> Bool: -# """Compares two FlagSets for equality. - -# Args: -# other: The other FlagSet to compare against. - -# Returns: -# True if the FlagSets are equal, False otherwise. -# """ -# return self.flags == other.flags - -# fn __ne__(self, other: Self) -> Bool: -# """Compares two FlagSets for inequality. - -# Args: -# other: The other FlagSet to compare against. - -# Returns: -# True if the FlagSets are not equal, False otherwise. -# """ -# return self.flags != other.flags - -# fn __add__(mut self, other: Self) -> Self: -# """Merges two FlagSets together. - -# Args: -# other: The other FlagSet to merge with. - -# Returns: -# A new FlagSet with the merged flags. -# """ -# new = Self(self) -# for flag in other.flags: -# new.flags.append(flag[]) -# return new - -# fn __iadd__(mut self, other: Self): -# """Merges another FlagSet into this FlagSet. - -# Args: -# other: The other FlagSet to merge with. -# """ -# self.merge(other) - -# fn merge(mut self, new_set: Self) -> None: -# """Adds flags from another FlagSet. If a flag is already present, the flag from the new set is ignored. - -# Args: -# new_set: The flag set to add. -# """ - -# @always_inline -# fn add_flag(flag: Flag) capturing -> None: -# try: -# _ = self.lookup(flag.name) -# except e: -# if str(e).find("FlagNotFoundError") != -1: -# self.flags.append(flag) - -# visit_all[add_flag](new_set.flags) - - fn set_annotation(mut flags: List[Flag], name: String, key: String, values: String) raises -> None: """Sets an annotation for a flag. diff --git a/src/prism/util.mojo b/src/prism/util.mojo index 68d5d8c..7487721 100644 --- a/src/prism/util.mojo +++ b/src/prism/util.mojo @@ -1,7 +1,19 @@ +from sys import exit from collections import InlineList from memory import ArcPointer +fn panic[W: Writable, //](message: W, code: Int = 1) -> None: + """Panics with the given message. + + Args: + message: The message to panic with. + code: The exit code to use. + """ + print(message) + exit(code) + + fn split(text: String, sep: String, max_split: Int = -1) -> List[String]: """Splits a string into a list of substrings. @@ -28,7 +40,7 @@ fn string_to_bool(value: String) -> Bool: Returns: The boolean equivalent of the string. """ - return value in ["true", "True", "1"] + return value in List[String]("true", "True", "1") fn to_string[T: StringableCollectionElement](vector: List[ArcPointer[T]]) -> String: diff --git a/test/test_args.mojo b/test/test_args.mojo index 62d6ba8..4847e3d 100644 --- a/test/test_args.mojo +++ b/test/test_args.mojo @@ -1,4 +1,4 @@ -from memory import ArcPointerPointer +from memory import ArcPointer import testing from prism import Command, Context from prism.args import ( @@ -9,7 +9,7 @@ from prism.args import ( maximum_n_args, exact_args, range_args, - # match_all, + match_all, ArgValidatorFn, ) @@ -20,8 +20,8 @@ fn dummy(ctx: Context) -> None: def test_no_args(): ctx = Context( - Command(name="root", usage="Base command.", run=dummy), - List[String]("abc") + args=List[String]("abc"), + command=Command(name="root", usage="Base command.", run=dummy), ) with testing.assert_raises(contains="does not take any arguments."): no_args(ctx) @@ -29,8 +29,8 @@ def test_no_args(): def test_valid_args(): ctx = Context( - Command(name="root", usage="Base command.", run=dummy, valid_args=List[String]("Pineapple")), - List[String]("abc") + args=List[String]("abc"), + command=Command(name="root", usage="Base command.", run=dummy, valid_args=List[String]("Pineapple")), ) with testing.assert_raises(contains="Invalid argument: `abc`"): valid_args(ctx) @@ -38,8 +38,8 @@ def test_valid_args(): def test_arbitrary_args(): ctx = Context( - Command(name="root", usage="Base command.", run=dummy), - List[String]("abc", "blah", "blah") + command=Command(name="root", usage="Base command.", run=dummy), + args=List[String]("abc", "blah", "blah") ) # It should not raise an error, ever. @@ -48,8 +48,8 @@ def test_arbitrary_args(): def test_minimum_n_args(): ctx = Context( - Command(name="root", usage="Base command.", run=dummy), - List[String]("abc", "123") + command=Command(name="root", usage="Base command.", run=dummy), + args=List[String]("abc", "123") ) with testing.assert_raises(contains="accepts at least 3 argument(s). Received: 2."): minimum_n_args[3]()(ctx) @@ -57,8 +57,8 @@ def test_minimum_n_args(): def test_maximum_n_args(): ctx = Context( - Command(name="root", usage="Base command.", run=dummy), - List[String]("abc", "123") + command=Command(name="root", usage="Base command.", run=dummy), + args=List[String]("abc", "123") ) with testing.assert_raises(contains="accepts at most 1 argument(s). Received: 2."): maximum_n_args[1]()(ctx) @@ -66,8 +66,8 @@ def test_maximum_n_args(): def test_exact_args(): ctx = Context( - Command(name="root", usage="Base command.", run=dummy), - List[String]("abc", "123") + command=Command(name="root", usage="Base command.", run=dummy), + args=List[String]("abc", "123") ) with testing.assert_raises(contains="accepts exactly 1 argument(s). Received: 2."): exact_args[1]()(ctx) @@ -75,18 +75,17 @@ def test_exact_args(): def test_range_args(): ctx = Context( - Command(name="root", usage="Base command.", run=dummy), - List[String]("abc", "123") + command=Command(name="root", usage="Base command.", run=dummy), + args=List[String]("abc", "123") ) with testing.assert_raises(contains="accepts between 0 to 1 argument(s). Received: 2."): range_args[0, 1]()(ctx) -# def test_match_all(): -# ctx = Context( -# Command(name="root", usage="Base command.", run=dummy, valid_args=List[String]("Pineapple")), -# List[String]("abc", "123") -# ) -# alias validators = List[ArgValidatorFn](range_args[0, 1](), valid_args) -# with testing.assert_raises(contains="accepts between 0 to 1 argument(s). Received: 2."): -# match_all[validators]()(ctx) +def test_match_all(): + ctx = Context( + command=Command(name="root", usage="Base command.", run=dummy, valid_args=List[String]("Pineapple")), + args=List[String]("abc", "123") + ) + with testing.assert_raises(contains="accepts between 0 to 1 argument(s). Received: 2."): + match_all[range_args[0, 1](), valid_args]()(ctx) diff --git a/test/test_command.mojo b/test/test_command.mojo index 40761de..f1454ac 100644 --- a/test/test_command.mojo +++ b/test/test_command.mojo @@ -1,22 +1,22 @@ -from memory import ArcPointerPointer +from memory import ArcPointer import testing -from prism.command import Command, Context -from prism.flag_set import FlagSet +from prism.command import Command, Context, Flag +import prism def test_command_operations(): fn dummy(ctx: Context) -> None: return None - cmd = Command(name="root", usage="Base command.", run=dummy) - for flag in cmd.flags.flags: + cmd = Command( + name="root", + usage="Base command.", + run=dummy, + children=List[ArcPointer[Command]]( + ArcPointer(Command(name="child", usage="Child command.", run=dummy, flags=List[Flag](prism.uint32_flag(name="color", shorthand="c", usage="Text color", default=0x3464eb)))) + ) + ) + for flag in cmd.flags: testing.assert_equal("help", flag[].name) - child_cmd = ArcPointer(Command(name="child", usage="Child command.", run=dummy)) - cmd.add_subcommand(child_cmd) - child_cmd[].flags.string_flag(name="color", shorthand="c", usage="Text color", default="#3464eb") - - testing.assert_equal(child_cmd[].full_name(), "root child") - - # help_test = MojoTest("Testing Command.help") - # cmd.help() + # testing.assert_equal(child_cmd[].full_name(), "root child") diff --git a/test/test_flags.mojo b/test/test_flags.mojo index 034daa2..0b85538 100644 --- a/test/test_flags.mojo +++ b/test/test_flags.mojo @@ -1,56 +1,79 @@ -from memory import ArcPointerPointer +from memory import ArcPointer import testing +import prism +from prism import Command, Context from prism.flag import Flag -from prism.flag_set import FlagSet, string_to_bool +from prism.flag_set import string_to_bool, from_args from prism.flag_parser import FlagParser def test_string_to_bool(): - truthy = List[String]("true", "True", "1") + alias truthy = List[String]("true", "True", "1") for t in truthy: testing.assert_true(string_to_bool(t[])) +fn dummy(ctx: Context) -> None: + return None + def test_get_flags(): - flag_set = FlagSet() - flag_set.string_flag("key", "usage", "default") - flag_set.bool_flag("flag", "usage", "False") - flags = List[String]("--key=value", "positional", "--flag") + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.string_flag(name="key", usage="usage", default="default"), + prism.bool_flag(name="flag", usage="usage", default=False), + ), + ) - _ = flag_set.from_args(flags) - testing.assert_equal(flag_set.get_string("key"), "value") - testing.assert_equal(flag_set.get_bool("flag"), True) + var args = List[String]("--key=value", "positional", "--flag") + _ = from_args(cmd.flags, args) + testing.assert_equal(cmd.get_string("key"), "value") + testing.assert_equal(cmd.get_bool("flag"), True) def test_parse_flag(): - flag_set = FlagSet() - flag_set.string_flag(name="key", usage="usage", default="default") - flag_set.bool_flag(name="flag", usage="usage", default=False) + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.string_flag(name="key", usage="usage", default="default"), + prism.bool_flag(name="flag", usage="usage", default=False), + ), + ) parser = FlagParser() - name, value, increment_by = parser.parse_flag("--key", List[String]("--key", "value"), flag_set) + name, value, increment_by = parser.parse_flag("--key", List[String]("--key", "value"), cmd.flags) testing.assert_equal(name, "key") testing.assert_equal(value, "value") testing.assert_equal(increment_by, 2) - name, value, increment_by = parser.parse_flag(String("--key=value"), List[String]("--key=value"), flag_set) + name, value, increment_by = parser.parse_flag(String("--key=value"), List[String]("--key=value"), cmd.flags) testing.assert_equal(name, "key") testing.assert_equal(value, "value") testing.assert_equal(increment_by, 1) def test_parse_shorthand_flag(): - flag_set = FlagSet() - flag_set.string_flag(name="key", usage="usage", default="default", shorthand="k") - flag_set.bool_flag(name="flag", usage="usage", default=False, shorthand="f") + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.string_flag(name="key", usage="usage", default="default", shorthand="k"), + prism.bool_flag(name="flag", usage="usage", default=False, shorthand="f"), + ), + ) parser = FlagParser() - name, value, increment_by = parser.parse_shorthand_flag("-k", List[String]("-k", "value"), flag_set) + name, value, increment_by = parser.parse_shorthand_flag("-k", List[String]("-k", "value"), cmd.flags) testing.assert_equal(name, "key") testing.assert_equal(value, "value") testing.assert_equal(increment_by, 2) - name, value, increment_by = parser.parse_shorthand_flag("-k=value", List[String]("-k=value"), flag_set) + name, value, increment_by = parser.parse_shorthand_flag("-k=value", List[String]("-k=value"), cmd.flags) testing.assert_equal(name, "key") testing.assert_equal(value, "value") testing.assert_equal(increment_by, 1) From 3b45c85200f4aa8e89ca62b55b42febeff37ab85 Mon Sep 17 00:00:00 2001 From: Mikhail Tavarez Date: Thu, 2 Jan 2025 14:05:47 -0600 Subject: [PATCH 5/7] fix get add funcs --- examples/flag_action.mojo | 5 +- src/prism/__init__.mojo | 4 +- src/prism/_flag_group.mojo | 195 ++++ .../{flag_parser.mojo => _flag_parser.mojo} | 8 +- src/prism/_flag_set.mojo | 216 +++++ src/prism/{util.mojo => _util.mojo} | 0 src/prism/command.mojo | 233 ++--- src/prism/flag.mojo | 686 ++++++++++++- src/prism/flag_group.mojo | 212 ---- src/prism/flag_set.mojo | 917 ------------------ test/test_command.mojo | 2 +- test/test_flags.mojo | 282 +++++- 12 files changed, 1484 insertions(+), 1276 deletions(-) create mode 100644 src/prism/_flag_group.mojo rename src/prism/{flag_parser.mojo => _flag_parser.mojo} (97%) create mode 100644 src/prism/_flag_set.mojo rename src/prism/{util.mojo => _util.mojo} (100%) delete mode 100644 src/prism/flag_group.mojo delete mode 100644 src/prism/flag_set.mojo diff --git a/examples/flag_action.mojo b/examples/flag_action.mojo index 4c4ccaa..2792450 100644 --- a/examples/flag_action.mojo +++ b/examples/flag_action.mojo @@ -1,7 +1,6 @@ from memory import ArcPointer from prism import Command, Context, Flag -from prism.flag_set import string_flag - +import prism fn test(ctx: Context) raises -> None: name = ctx.command[].get_string("name") @@ -19,7 +18,7 @@ fn main() -> None: usage="Greet a user!", raising_run=test, flags=List[Flag]( - string_flag( + prism.string_flag( name="name", shorthand="n", usage="The name of the person to greet.", diff --git a/src/prism/__init__.mojo b/src/prism/__init__.mojo index daa912d..3c180ad 100644 --- a/src/prism/__init__.mojo +++ b/src/prism/__init__.mojo @@ -1,7 +1,7 @@ from .command import Command from .args import no_args, valid_args, arbitrary_args, minimum_n_args, maximum_n_args, exact_args, range_args -from .flag import Flag -from .flag_set import ( +from .flag import ( + Flag, string_flag, bool_flag, int_flag, diff --git a/src/prism/_flag_group.mojo b/src/prism/_flag_group.mojo new file mode 100644 index 0000000..9e3e4b1 --- /dev/null +++ b/src/prism/_flag_group.mojo @@ -0,0 +1,195 @@ +from collections.dict import Dict, DictEntry +from .flag import Flag +from ._flag_set import REQUIRED, REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE, visit_all, names +from ._util import panic + + +fn has_all_flags(flags: List[Flag], owned flag_names: List[String]) -> Bool: + """Checks if all flags are defined in the flag set. + + Args: + flags: The command's flags to check. + flag_names: The names of the flags to check for. + + Returns: + True if all flags are defined, False otherwise. + """ + var names = names(flags) + for name in flag_names: + if name[] not in names: + return False + return True + + +fn process_group_annotations[annotation: String]( + flags: List[Flag], + flag: Flag, + mut group_status: Dict[String, Dict[String, Bool]], +) raises -> None: + """Processes a flag for a group annotation. + + Parameters: + annotation: The annotation to check for. + + Args: + flags: The flag set to check for the flags. + flag: The flag to process. + group_status: The status of the flag groups. + + Raises: + Error: If an error occurred while processing the flag. + """ + var fg_annotations = flag.annotations.get(annotation, List[String]()) + if not fg_annotations: + return + + for group in fg_annotations: + if len(group_status.get(group[], Dict[String, Bool]())) == 0: + var flag_names = group[].split(sep=" ") + + # Only consider this flag group at all if all the flags are defined. + if not has_all_flags(flags, flag_names): + continue + + for name in flag_names: + var entry = Dict[String, Bool]() + entry[name[]] = False + group_status[group[]] = entry + + # If flag.changed = True, then it had a value set on it. + try: + group_status[group[]][flag.name] = flag.changed + except e: + raise Error( + "process_group_annotations: Failed to set group status for annotation {}: {}.".format( + annotation, str(e) + ) + ) + + +fn validate_required_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: + """Validates that all flags in a group are set if any are set. + This is for flags that are marked as required via `Command(flags_required_together=...)`. + + Args: + data: The dictionary of flag groups to validate. + + Raises: + Error: If an error occurred while validating the flag groups. + """ + # Within each group, is a Dict of flag name and if they're set. + # If it's unset then add to a list to check the condition of all required flags being set. + for pair in data.items(): + var unset = List[String]() + for flag in pair[].value.items(): + if not flag[].value: + unset.append(flag[].key) + + if len(unset) == len(pair[].value) or len(unset) == 0: + continue + + var keys = extract_keys(pair[]) + alias msg = "If any flags in the group, {}, are set they must all be set; missing {}." + panic(msg.format(keys.__str__(), unset.__str__())) + + +fn get_set_flags(pair: DictEntry[String, Dict[String, Bool]]) -> List[String]: + """Returns a list of flags that are set. + + Args: + pair: The key value pair to check. + + Returns: + A list of flags that are set. + """ + var set = List[String]() + for flag in pair.value.items(): + if flag[].value: + set.append(flag[].key) + return set + + +fn extract_keys(pair: DictEntry[String, Dict[String, Bool]]) -> List[String]: + """Extracts the keys from a dictionary entry. + + Args: + pair: The key value pair to extract the keys from. + + Returns: + A list of keys. + """ + var keys = List[String]() + for key in pair.value.keys(): + keys.append(key[]) + sort(keys) + return keys + + +fn validate_one_required_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: + """Validates that at least one flag in a group is set. + This is for flags that are marked as required via `Command(one_required_flags=...)`. + + Args: + data: The dictionary of flag groups to validate. + + Raises: + Error: If an error occurred while validating the flag groups. + """ + # Check if at least one key is set. + for pair in data.items(): + var set = get_set_flags(pair[]) + if len(set) >= 1: + continue + + var keys = extract_keys(pair[]) + panic("At least one of the flags in the group {} is required.".format(keys.__str__())) + + +fn validate_mutually_exclusive_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: + """Validates that only one flag in a group is set. + This is for flags that are marked as required via `Command(mutually_exclusive_flags=...)`. + + Args: + data: The dictionary of flag groups to validate. + + Raises: + Error: If an error occurred while validating the flag groups. + """ + # Check if more than one mutually exclusive flag is set. + for pair in data.items(): + var set = get_set_flags(pair[]) + if len(set) == 0 or len(set) == 1: + continue + + var keys = extract_keys(pair[]) + alias msg = "If any flags in the group {} are set none of the others can be; {} were all set." + panic(msg.format(keys.__str__(), set.__str__())) + + +fn validate_flag_groups(flags: List[Flag]) raises -> None: + """Validates the status of flag groups. + Checks for flags annotated with the `REQUIRED_AS_GROUP`, `ONE_REQUIRED`, or `MUTUALLY_EXCLUSIVE` annotations. + Then validates if the flags in the group are set correctly to satisfy the annotation. + + Args: + flags: The flags to validate. + + Raises: + Error: If an error occurred while validating the flag groups. + """ + var group_status = Dict[String, Dict[String, Bool]]() + var one_required_group_status = Dict[String, Dict[String, Bool]]() + var mutually_exclusive_group_status = Dict[String, Dict[String, Bool]]() + + @parameter + fn flag_checker(flag: Flag) raises -> None: + process_group_annotations[REQUIRED_AS_GROUP](flags, flag, group_status) + process_group_annotations[ONE_REQUIRED](flags, flag, one_required_group_status) + process_group_annotations[MUTUALLY_EXCLUSIVE](flags, flag, mutually_exclusive_group_status) + + visit_all[flag_checker](flags) + + # Validate required flag groups + validate_required_flag_group(group_status) + validate_one_required_flag_group(one_required_group_status) + validate_mutually_exclusive_flag_group(mutually_exclusive_group_status) diff --git a/src/prism/flag_parser.mojo b/src/prism/_flag_parser.mojo similarity index 97% rename from src/prism/flag_parser.mojo rename to src/prism/_flag_parser.mojo index c6ae35c..595ffc8 100644 --- a/src/prism/flag_parser.mojo +++ b/src/prism/_flag_parser.mojo @@ -1,8 +1,8 @@ import os from memory import Span from collections import InlineArray -from .flag_set import names, lookup, lookup_name -from .util import split +from ._flag_set import names, lookup, lookup_name +from ._util import split struct FlagParser: @@ -49,7 +49,7 @@ struct FlagParser: # If it's a bool flag, set it to True and only increment the index by 1 (one arg used). try: - _ = lookup(flags, name, "Bool") + _ = lookup["Bool"](flags, name) return name, String("True"), 1 except: pass @@ -98,7 +98,7 @@ struct FlagParser: # If it's a bool flag, set it to True and only increment the index by 1 (one arg used). try: - _ = lookup(flags, name, "Bool") + _ = lookup["Bool"](flags, name) return name, String("True"), 1 except: pass diff --git a/src/prism/_flag_set.mojo b/src/prism/_flag_set.mojo new file mode 100644 index 0000000..2030fd3 --- /dev/null +++ b/src/prism/_flag_set.mojo @@ -0,0 +1,216 @@ +from collections import Optional, Dict, InlineList +from utils import Variant +from memory import Pointer +from .flag import Flag, FlagActionFn +from ._util import string_to_bool, split +from ._flag_parser import FlagParser + + +alias FlagVisitorFn = fn (Flag) capturing -> None +"""Function perform some action while visiting all flags.""" +alias FlagVisitorRaisingFn = fn (Flag) capturing raises -> None +"""Function perform some action while visiting all flags. Can raise.""" + +# Individual flag annotations +alias REQUIRED = "REQUIRED" + +# Flag Group annotations +alias REQUIRED_AS_GROUP = "REQUIRED_AS_GROUP" +alias ONE_REQUIRED = "ONE_REQUIRED" +alias MUTUALLY_EXCLUSIVE = "MUTUALLY_EXCLUSIVE" + + +fn set_annotation(mut flags: List[Flag], name: String, key: String, values: String) raises -> None: + """Sets an annotation for a flag. + + Args: + flags: The flags to set the annotation for. + name: The name of the flag to set the annotation for. + key: The key of the annotation. + values: The values of the annotation. + + Raises: + Error: If setting the value for the annotation fails. + """ + # Annotation value can be a concatenated string of values. + # Why? Because we can have multiple required groups of flags for example. + # So each value of the list for the annotation can be a group of flag names. + var flag = lookup(flags, name) + try: + flag[].annotations[key].extend(values) + except: + flag[].annotations[key] = List[String](values) + + +fn set_as[annotation_type: String](mut flags: List[Flag], name: String, names: String) raises -> None: + """Sets a flag as a specific annotation type. + + Parameters: + annotation_type: The type of annotation to set. + + Args: + flags: The flags to set the annotation for. + name: The name of the flag to set the annotation for. + names: The values of the annotation. + + Raises: + Error: If the annotation type is not one of `REQUIRED_AS_GROUP`, `ONE_REQUIRED`, or `MUTUALLY_EXCLUSIVE`. + """ + constrained[ + annotation_type not in [REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE], + "annotation_type must be one of REQUIRED_AS_GROUP, ONE_REQUIRED, or MUTUALLY_EXCLUSIVE.", + ]() + try: + set_annotation(flags, name, annotation_type, names) + except e: + print( + "FlagSet.set_as: Failed to set flag, {}, with the following annotation: {}".format(name, annotation_type), + file=2, + ) + raise e + + +fn from_args(mut flags: List[Flag], arguments: List[String]) raises -> List[String]: + """Parses flags and args from the args passed via the command line and adds them to their appropriate collections. + + Args: + flags: The flags to parse. + arguments: The arguments passed via the command line. + + Returns: + The remaining arguments after parsing out flags. + + Raises: + Error: If a flag is not recognized. + """ + var parser = FlagParser() + return parser.parse(flags, arguments) + + +fn names(flags: List[Flag]) -> List[String]: + """Returns a list of names of all flags in the flag set. + + Args: + flags: The flags to get the names for. + + Returns: + A list of names of all flags in the flag set. + """ + var result = List[String](capacity=len(flags)) + for flag in flags: + result.append(flag[].name) + return result + + +fn shorthands(flags: List[Flag]) -> List[String]: + """Returns a list of shorthands of all flags in the flag set. + + Args: + flags: The flags to get the shorthands for. + + Returns: + A list of shorthands of all flags in the flag set. + """ + var result = List[String](capacity=len(flags)) + for flag in flags: + if flag[].shorthand: + result.append(flag[].shorthand) + return result + + +fn visit_all[visitor: FlagVisitorFn](flags: List[Flag]) -> None: + """Visits all flags in the flag set. + + Parameters: + visitor: The visitor function to call for each flag. + """ + for flag in flags: + visitor(flag[]) + + +fn visit_all[visitor: FlagVisitorRaisingFn](flags: List[Flag]) raises -> None: + """Visits all flags in the flag set. + + Parameters: + visitor: The visitor function to call for each flag. + + Raises: + Error: If the visitor raises an error. + """ + for flag in flags: + visitor(flag[]) + + +fn validate_required_flags(flags: List[Flag]) raises -> None: + """Validates all required flags are present and returns an error otherwise. + + Args: + flags: The flags to validate. + + Raises: + Error: If a required flag is not set. + """ + var missing_flag_names = List[String]() + + @parameter + fn check_required_flag(flag: Flag) -> None: + if flag.required and not flag.changed: + missing_flag_names.append(flag.name) + + visit_all[check_required_flag](flags) + if len(missing_flag_names) > 0: + raise Error("Required flag(s): " + missing_flag_names.__str__() + " not set.") + + +fn lookup[type: String = ""](ref flags: List[Flag], name: String) raises -> Pointer[Flag, __origin_of(flags)]: + """Returns an mutable or immutable Pointer to a Flag with the given name. + Mutable if FlagSet is mutable, immutable if FlagSet is immutable. + + Parameters: + type: The type of the Flag to lookup. + + Args: + flags: The flags to lookup. + name: The name of the Flag to lookup. + + Returns: + Optional Pointer to the Flag. + + Raises: + Error: If the Flag is not found. + """ + constrained[ + type not in ["String", "Bool", "Int", "Int8", "Int16", "Int32", "Int64", "UInt", "UInt8", "UInt16", "UInt32", "UInt64", "Float16", "Float32", "Float64", "StringList", "IntList", "Float64List"], + "type must be one of `String`, `Bool`, `Int`, `Int8`, `Int16`, `Int32`, `Int64`, `UInt`, `UInt8`, `UInt16`, `UInt32`, `UInt64`, `Float16`, `Float32`, `Float64`, `StringList`, `IntList`, `Float64List`.", + ]() + if type == "": + for i in range(len(flags)): + if flags[i].name == name: + return Pointer.address_of(flags[i]) + else: + for i in range(len(flags)): + print(flags[i].name, name, flags[i].name == name, flags[i].type, type, flags[i].type == type) + if flags[i].name == name and flags[i].type == type: + return Pointer.address_of(flags[i]) + + raise Error("FlagNotFoundError: Could not find the following flag: " + name) + + +fn lookup_name(flags: List[Flag], shorthand: String) raises -> String: + """Returns the name of a flag given its shorthand. + + Args: + flags: The flags to lookup. + shorthand: The shorthand of the flag to lookup. + + Returns: + The name of the flag. + + Raises: + Error: If the flag is not found. + """ + for flag in flags: + if flag[].shorthand and flag[].shorthand == shorthand: + return flag[].name + + raise Error("FlagNotFoundError: Could not find the following flag shorthand: " + shorthand) diff --git a/src/prism/util.mojo b/src/prism/_util.mojo similarity index 100% rename from src/prism/util.mojo rename to src/prism/_util.mojo diff --git a/src/prism/command.mojo b/src/prism/command.mojo index 6c55369..2a065b5 100644 --- a/src/prism/command.mojo +++ b/src/prism/command.mojo @@ -2,9 +2,9 @@ from sys import argv from collections import Optional, Dict, InlineList from memory import ArcPointer import mog -from .util import to_string, to_list, string_to_bool, panic -from .flag import Flag -from .flag_set import ( +from ._util import to_string, to_list, string_to_bool, panic +from .flag import Flag, bool_flag +from ._flag_set import ( visit_all, validate_required_flags, from_args, @@ -14,10 +14,9 @@ from .flag_set import ( MUTUALLY_EXCLUSIVE, set_as, set_annotation, - bool_flag, - string_flag, + lookup ) -from .flag_group import validate_flag_groups +from ._flag_group import validate_flag_groups from .args import arbitrary_args, get_args from .context import Context @@ -212,18 +211,9 @@ struct Command(CollectionElement, Writable, Stringable): var valid_args: List[String] """Valid arguments for the command.""" - var local_flags: List[Flag] - """Local flags for the command. TODO: Use this field to store cached results for local flags.""" - - var persistent_flags: List[Flag] - """Local flags that also persist to children.""" - var flags: List[Flag] """It is all local, persistent, and inherited flags.""" - var _inherited_flags: List[Flag] - """Cached results from self._merge_flags().""" - var children: List[ArcPointer[Self]] """Child commands.""" # TODO: An optional pointer would be great, but it breaks the compiler. So a list of 0-1 pointers is used. @@ -251,6 +241,7 @@ struct Command(CollectionElement, Writable, Stringable): flags: List[Flag] = List[Flag](), flags_required_together: Optional[List[String]] = None, mutually_exclusive_flags: Optional[List[String]] = None, + one_required_flags: Optional[List[String]] = None, arg_validator: Optional[ArgValidatorFn] = None, ): """Constructs a new `Command`. @@ -274,6 +265,7 @@ struct Command(CollectionElement, Writable, Stringable): flags: The flags for the command. flags_required_together: The flags that are required together. mutually_exclusive_flags: The flags that are mutually exclusive. + one_required_flags: The flags where at least one is required. arg_validator: The function to validate arguments passed to the command. """ if not run and not raising_run: @@ -306,9 +298,6 @@ struct Command(CollectionElement, Writable, Stringable): self.valid_args = valid_args self.flags = flags - self.local_flags = List[Flag]() - self.persistent_flags = List[Flag]() - self._inherited_flags = List[Flag]() self.parent = List[ArcPointer[Self]](capacity=1) self.children = children @@ -319,10 +308,11 @@ struct Command(CollectionElement, Writable, Stringable): command[][].parent.append(self) if flags_required_together: - self._mark_flags_required_together(flags_required_together.value()) - + self._mark_flag_group_as[REQUIRED_AS_GROUP](flags_required_together.value()) if mutually_exclusive_flags: - self._mark_flags_mutually_exclusive(mutually_exclusive_flags.value()) + self._mark_flag_group_as[MUTUALLY_EXCLUSIVE](mutually_exclusive_flags.value()) + if one_required_flags: + self._mark_flag_group_as[ONE_REQUIRED](one_required_flags.value()) self.flags.append(bool_flag(name="help", shorthand="h", usage="Displays help information about the command.")) @@ -354,9 +344,6 @@ struct Command(CollectionElement, Writable, Stringable): self.arg_validator = existing.arg_validator self.valid_args = existing.valid_args^ self.flags = existing.flags^ - self.local_flags = existing.local_flags^ - self.persistent_flags = existing.persistent_flags^ - self._inherited_flags = existing._inherited_flags^ self.children = existing.children^ self.parent = existing.parent^ @@ -438,10 +425,10 @@ struct Command(CollectionElement, Writable, Stringable): Returns: The command that matches the argument and the remaining children to traverse. """ - for command_ref in children: - if command_ref[][].name == arg or arg in command_ref[][].aliases: + for cmd in children: + if cmd[][].name == arg or arg in cmd[][].aliases: leftover_start += 1 - return command_ref[][], command_ref[][].children + return cmd[][], cmd[][].children return command, children @@ -554,13 +541,13 @@ struct Command(CollectionElement, Writable, Stringable): # Always execute from the root command, regardless of what command was executed in main. if self.has_parent(): - var root = self.root() - return root[].execute() + return self.root()[].execute() command, remaining_args = self._parse_command_from_args(_get_args_as_list()) + var command_ptr = ArcPointer(command^) # Give ownership to the pointer, for consistency. - # Merge local and inherited flags - command._merge_flags() + # Merge persistent flags from ancestors. + command_ptr[]._merge_flags() # Add all parents to the list to check if they have persistent pre/post hooks. var parents = List[ArcPointer[Self]]() @@ -569,7 +556,7 @@ struct Command(CollectionElement, Writable, Stringable): fn append_parents(parent: ArcPointer[Self]) capturing -> None: parents.append(parent) - command.visit_parents[append_parents]() + command_ptr[].visit_parents[append_parents]() # If ENABLE_TRAVERSE_RUN_HOOKS is True, reverse the list to start from the root command rather than # from the child. This is because all of the persistent hooks will be run. @@ -579,40 +566,38 @@ struct Command(CollectionElement, Writable, Stringable): try: # Get the flags for the command to be executed. - var remaining_args = from_args(command.flags, remaining_args) + remaining_args = from_args(command_ptr[].flags, remaining_args) # Check if the help flag was passed - var help_passed = command.get_bool("help") - var command_ref = ArcPointer(command) - if help_passed == True: - print(command.help(command_ref)) - return None + if command_ptr[].get_bool("help") == True: + print(command_ptr[].help(command_ptr)) + return # Validate individual required flags (eg: flag is required) - validate_required_flags(command.flags) + validate_required_flags(command_ptr[].flags) # Validate flag groups (eg: one of required, mutually exclusive, required together) - validate_flag_groups(command.flags) + validate_flag_groups(command_ptr[].flags) # Run flag actions if they have any - var ctx = Context(remaining_args, command_ref) + var ctx = Context(remaining_args, command_ptr) @parameter fn run_action(flag: Flag) raises -> None: if flag.action and flag.value: flag.action.value()(ctx, flag.value.value()) - visit_all[run_action](command.flags) + visit_all[run_action](command_ptr[].flags) # Validate the remaining arguments - command.arg_validator(ctx) + command_ptr[].arg_validator(ctx) # Run the function's commands. self._execute_pre_run_hooks(ctx, parents) - if command.run: - command.run.value()(ctx) + if command_ptr[].run: + command_ptr[].run.value()(ctx) else: - command.raising_run.value()(ctx) + command_ptr[].raising_run.value()(ctx) self._execute_post_run_hooks(ctx, parents) except e: panic(e) @@ -636,9 +621,7 @@ struct Command(CollectionElement, Writable, Stringable): fn _merge_flags(mut self): """Returns all flags for the command and inherited flags from its parent.""" - self.flags += self.persistent_flags - self._inherited_flags = self.inherited_flags() - self.flags += self._inherited_flags + self.flags += self.inherited_flags() # fn add_subcommand(mut self, mut command: ArcPointer[Self]): # """Adds child command and set's child's parent attribute to self. @@ -651,49 +634,29 @@ struct Command(CollectionElement, Writable, Stringable): # command[].parent[0] = self # else: # command[].parent.append(self) - - fn _mark_flags_required_together(mut self, flag_names: List[String]) -> None: - """Marks the given flags with annotations so that `Prism` errors - if the command is invoked with a subset (but not all) of the given flags. - - Args: - flag_names: The names of the flags to mark as required together. - """ - self._merge_flags() - var names = _concat_names(flag_names) - try: - for flag_name in flag_names: - set_as[REQUIRED_AS_GROUP](self.flags, flag_name[], names) - except e: - panic(e) - fn _mark_flags_one_required(mut self, *flag_names: String) -> None: + fn _mark_flag_group_as[annotation: String](mut self, flag_names: List[String]) -> None: """Marks the given flags with annotations so that `Prism` errors - if the command is invoked without at least one flag from the given set of flags. - Args: - flag_names: The names of the flags to mark as required. - """ - self._merge_flags() - var names = _concat_names(flag_names) - try: - for flag_name in flag_names: - set_as[ONE_REQUIRED](self.flags, flag_name[], names) - except e: - panic(e) - - fn _mark_flags_mutually_exclusive(mut self, flag_names: List[String]) -> None: - """Marks the given flags with annotations so that `Prism` errors - if the command is invoked with more than one flag from the given set of flags. + Parameters: + annotation: The annotation to set on the flags. Args: - flag_names: The names of the flags to mark as mutually exclusive. - """ + flag_names: The names of the flags to mark as required together. + + #### Notes: + - If the annotation is `REQUIRED_AS_GROUP`, then all the flags in the group must be set. + - If the annotation is `ONE_REQUIRED`, then at least one flag in the group must be set. + - If the annotation is `MUTUALLY_EXCLUSIVE`, then only one flag in the group can be set. + """ + constrained[ + annotation not in [REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE], + "annotation must be one of REQUIRED_AS_GROUP, ONE_REQUIRED, or MUTUALLY_EXCLUSIVE.", + ]() self._merge_flags() - var names = _concat_names(flag_names) try: for flag_name in flag_names: - set_as[MUTUALLY_EXCLUSIVE](self.flags, flag_name[], names) + set_as[annotation](self.flags, flag_name[], _concat_names(flag_names)) except e: panic(e) @@ -715,31 +678,6 @@ struct Command(CollectionElement, Writable, Stringable): func(self.parent[0][]) self.parent[0][].visit_parents[func]() - fn lookup(ref self, name: String, type: String = "") raises -> Pointer[Flag, __origin_of(self.flags)]: - """Returns an mutable or immutable Pointer to a Flag with the given name. - Mutable if FlagSet is mutable, immutable if FlagSet is immutable. - - Args: - name: The name of the Flag to lookup. - type: The type of the Flag to lookup. - - Returns: - Optional Pointer to the Flag. - - Raises: - Error: If the Flag is not found. - """ - if type == "": - for i in range(len(self.flags)): - if self.flags[i].name == name: - return Pointer.address_of(self.flags[i]) - else: - for i in range(len(self.flags)): - if self.flags[i].name == name and self.flags[i].type == type: - return Pointer.address_of(self.flags[i]) - - raise Error("FlagNotFoundError: Could not find the following flag: " + name) - fn get_string(self, name: String) raises -> String: """Returns the value of a flag as a `String`. If it isn't set, then return the default value. @@ -752,7 +690,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self.lookup(name, "String")[].value_or_default() + return lookup["String"](self.flags, name)[].value_or_default() fn get_bool(self, name: String) raises -> Bool: """Returns the value of a flag as a `Bool`. If it isn't set, then return the default value. @@ -766,14 +704,16 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return string_to_bool(self.lookup(name, "Bool")[].value_or_default()) + return string_to_bool(lookup["Bool"](self.flags, name)[].value_or_default()) - fn get_int(self, name: String, type: String = "Int") raises -> Int: + fn get_int[type: String = "Int"](self, name: String) raises -> Int: """Returns the value of a flag as an `Int`. If it isn't set, then return the default value. + Parameters: + type: The type of the flag. + Args: name: The name of the flag. - type: The type of the flag. Returns: The value of the flag as an `Int`. @@ -781,7 +721,11 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return atol(self.lookup(name, type)[].value_or_default()) + constrained[ + type not in ["Int", "Int8", "Int16", "Int32", "Int64", "UInt", "UInt8", "UInt16", "UInt32", "UInt64"], + "type must be one of `Int`, `Int8`, `Int16`, `Int32`, `Int64`, `UInt`, `UInt8`, `UInt16`, `UInt32`, or `UInt64`.", + ]() + return atol(lookup[type](self.flags, name)[].value_or_default()) fn get_int8(self, name: String) raises -> Int8: """Returns the value of a flag as a `Int8`. If it isn't set, then return the default value. @@ -795,7 +739,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return Int8(self.get_int(name, "Int8")) + return Int8(self.get_int["Int8"](name)) fn get_int16(self, name: String) raises -> Int16: """Returns the value of a flag as a `Int16`. If it isn't set, then return the default value. @@ -809,7 +753,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return Int16(self.get_int(name, "Int16")) + return Int16(self.get_int["Int16"](name)) fn get_int32(self, name: String) raises -> Int32: """Returns the value of a flag as a `Int32`. If it isn't set, then return the default value. @@ -823,7 +767,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return Int32(self.get_int(name, "Int32")) + return Int32(self.get_int["Int32"](name)) fn get_int64(self, name: String) raises -> Int64: """Returns the value of a flag as a `Int64`. If it isn't set, then return the default value. @@ -837,7 +781,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return Int64(self.get_int(name, "Int64")) + return Int64(self.get_int["Int64"](name)) fn get_uint(self, name: String) raises -> UInt: """Returns the value of a flag as a `UInt`. If it isn't set, then return the default value. @@ -851,7 +795,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt(self.get_int(name, "UInt")) + return UInt(self.get_int["UInt"](name)) fn get_uint8(self, name: String) raises -> UInt8: """Returns the value of a flag as a `UInt8`. If it isn't set, then return the default value. @@ -865,7 +809,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt8(self.get_int(name, "UInt8")) + return UInt8(self.get_int["UInt8"](name)) fn get_uint16(self, name: String) raises -> UInt16: """Returns the value of a flag as a `UInt16`. If it isn't set, then return the default value. @@ -879,7 +823,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt16(self.get_int(name, "UInt16")) + return UInt16(self.get_int["UInt16"](name)) fn get_uint32(self, name: String) raises -> UInt32: """Returns the value of a flag as a `UInt32`. If it isn't set, then return the default value. @@ -893,7 +837,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt32(self.get_int(name, "UInt32")) + return UInt32(self.get_int["UInt32"](name)) fn get_uint64(self, name: String) raises -> UInt64: """Returns the value of a flag as a `UInt64`. If it isn't set, then return the default value. @@ -907,7 +851,24 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt64(self.get_int(name, "UInt64")) + return UInt64(self.get_int["UInt64"](name)) + + fn get_float[type: String](self, name: String) raises -> Float64: + """Returns the value of a flag as a `Float64`. If it isn't set, then return the default value. + + Parameters: + type: The type of the flag. + + Args: + name: The name of the flag. + + Returns: + The value of the flag as a `Float64`. + + Raises: + Error: If the flag is not found. + """ + return atof(lookup[type](self.flags, name)[].value_or_default()) fn get_float16(self, name: String) raises -> Float16: """Returns the value of a flag as a `Float16`. If it isn't set, then return the default value. @@ -921,7 +882,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self.get_float64(name).cast[DType.float16]() + return self.get_float["Float16"](name).cast[DType.float16]() fn get_float32(self, name: String) raises -> Float32: """Returns the value of a flag as a `Float32`. If it isn't set, then return the default value. @@ -935,7 +896,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self.get_float64(name).cast[DType.float32]() + return self.get_float["Float32"](name).cast[DType.float32]() fn get_float64(self, name: String) raises -> Float64: """Returns the value of a flag as a `Float64`. If it isn't set, then return the default value. @@ -945,18 +906,20 @@ struct Command(CollectionElement, Writable, Stringable): Returns: The value of the flag as a `Float64`. - + Raises: Error: If the flag is not found. """ - return atof(self.lookup(name, "Float64")[].value_or_default()) + return self.get_float["Float64"](name) - fn _get_list(self, name: String, type: String) raises -> List[String]: + fn _get_list[type: String](self, name: String) raises -> List[String]: """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. + Parameters: + type: The type of the flag. + Args: name: The name of the flag. - type: The type of the flag. Returns: The value of the flag as a `List[String]`. @@ -964,7 +927,11 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self.lookup(name, type)[].value_or_default().split(sep=" ") + constrained[ + type not in ["StringList", "IntList", "Float64List"], + "type must be one of `StringList`, `IntList`, or `Float64List`.", + ]() + return lookup[type](self.flags, name)[].value_or_default().split(sep=" ") fn get_string_list(self, name: String) raises -> List[String]: """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. @@ -978,7 +945,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self._get_list(name, "StringList") + return self._get_list["StringList"](name) fn get_int_list(self, name: String) raises -> List[Int]: """Returns the value of a flag as a `List[Int]`. If it isn't set, then return the default value. @@ -992,7 +959,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - var values = self._get_list(name, "IntList") + var values = self._get_list["IntList"](name) var ints = List[Int](capacity=len(values)) for value in values: ints.append(atol(value[])) @@ -1010,7 +977,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - var values = self._get_list(name, "Float64List") + var values = self._get_list["Float64List"](name) var floats = List[Float64](capacity=len(values)) for value in values: floats.append(atof(value[])) diff --git a/src/prism/flag.mojo b/src/prism/flag.mojo index 84c6ef3..e66378c 100644 --- a/src/prism/flag.mojo +++ b/src/prism/flag.mojo @@ -9,7 +9,7 @@ alias FlagActionFn = fn (ctx: Context, value: String) raises -> None @value struct Flag(RepresentableCollectionElement, Stringable, Writable): """Represents a flag that can be passed via the command line. - Flags are passed in via --name or -shorthand and can have a value associated with them. + Flags are passed in via `--name` or `-shorthand` and can have a value associated with them. """ var name: String @@ -195,3 +195,687 @@ struct Flag(RepresentableCollectionElement, Stringable, Writable): The value of the flag or the default value. """ return self.value.or_else(self.default) + + +fn string_flag( + name: String, + usage: String, + shorthand: String = "", + default: String = "", + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `String` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="String", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn bool_flag( + name: String, + usage: String, + shorthand: String = "", + default: Bool = False, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Bool` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Bool", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int8_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int8 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int8` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int8", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int16_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int16 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int16", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int32_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int32 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int32", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int64_flag( + name: String, + usage: String, + shorthand: String = "", + default: Int64 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds an `Int64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Int64", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt8 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint8_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt8 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt8` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt8", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint16_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt16 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt16", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint32_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt32 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt32", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn uint64_flag( + name: String, + usage: String, + shorthand: String = "", + default: UInt64 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `UInt64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="UInt64", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn float16_flag( + name: String, + usage: String, + shorthand: String = "", + default: Float16 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Float16` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Float16", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn float32_flag( + name: String, + usage: String, + shorthand: String = "", + default: Float32 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Float32` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Float32", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn float64_flag( + name: String, + usage: String, + shorthand: String = "", + default: Float64 = 0, + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Float64` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=str(default), + type="Float64", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn string_list_flag( + name: String, + usage: String, + shorthand: String = "", + default: List[String] = List[String](), + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `StringList` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=" ".join(default), + type="StringList", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn int_list_flag( + name: String, + usage: String, + shorthand: String = "", + default: List[Int, True] = List[Int, True](), + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `IntList` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=" ".join(default), + type="IntList", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) + + +fn float64_list_flag( + name: String, + usage: String, + shorthand: String = "", + default: List[Float64, True] = List[Float64, True](), + environment_variable: Optional[StringLiteral] = None, + file_path: Optional[StringLiteral] = None, + action: Optional[FlagActionFn] = None, + required: Bool = False, + persistent: Bool = False, +) -> Flag: + """Adds a `Float64List` flag to the flag set. + + Args: + name: The name of the flag. + usage: The usage of the flag. + shorthand: The shorthand of the flag. + default: The default value of the flag. + environment_variable: The environment variable to check for a value. + file_path: The file to check for a value. + action: Function to run after the flag has been processed. + required: If the flag is required. + persistent: If the flag should persist to children commands. + """ + return Flag( + name=name, + shorthand=shorthand, + usage=usage, + default=" ".join(default), + type="Float64List", + environment_variable=environment_variable, + file_path=file_path, + action=action, + required=required, + persistent=persistent, + ) diff --git a/src/prism/flag_group.mojo b/src/prism/flag_group.mojo deleted file mode 100644 index 0579d18..0000000 --- a/src/prism/flag_group.mojo +++ /dev/null @@ -1,212 +0,0 @@ -from collections import Dict - -# from os import panic -from .flag import Flag -from .flag_set import REQUIRED, REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE, visit_all -from .util import panic - - -fn has_all_flags(flags: List[Flag], flag_names: List[String]) -> Bool: - """Checks if all flags are defined in the FlagSet. - - Args: - flags: The FlagSet to check for the flags. - flag_names: The names of the flags to check for. - - Returns: - True if all flags are defined, False otherwise. - """ - for name in flag_names: - for flag in flags: - if flag[].name == name[]: - return True - return False - - -fn process_flag_for_group_annotation( - flags: List[Flag], - flag: Flag, - annotation: String, - mut group_status: Dict[String, Dict[String, Bool]], -) raises -> None: - """Processes a flag for a group annotation. - - Args: - flags: The FlagSet to check for the flags. - flag: The flag to process. - annotation: The annotation to check for. - group_status: The status of the flag groups. - - Raises: - Error: If an error occurred while processing the flag. - """ - var group_info = flag.annotations.get(annotation, List[String]()) - if group_info: - for group in group_info: - var group_name = group[] - if len(group_status.get(group_name, Dict[String, Bool]())) == 0: - var flag_names = group_name.split(sep=" ") - - # Only consider this flag group at all if all the flags are defined. - if not has_all_flags(flags, flag_names): - continue - - for name in flag_names: - var entry = Dict[String, Bool]() - entry[name[]] = False - group_status[group[]] = entry - - # If flag.changed = True, then it had a value set on it. - try: - group_status[group[]][flag.name] = flag.changed - except e: - raise Error( - "process_flag_for_group_annotation: Failed to set group status for annotation {}: {}.".format( - annotation, str(e) - ) - ) - - -fn validate_required_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: - """Validates that all flags in a group are set if any are set. - This is for flags that are marked as required via `Command().mark_flags_required_together()`. - - Args: - data: The dictionary of flag groups to validate. - - Raises: - Error: If an error occurred while validating the flag groups. - """ - # Within each group, is a Dict of flag name and if they're set. - # If it's unset then add to a list to check the condition of all required flags being set. - for pair in data.items(): - var unset = List[String]() - for flag in pair[].value.items(): - if not flag[].value: - unset.append(flag[].key) - - if len(unset) == len(pair[].value) or len(unset) == 0: - continue - - # Sort values, so they can be tested/scripted against consistently. - # unset.sort() - var keys = List[String]() - for key in pair[].value.keys(): - keys.append(key[]) - - panic( - "If any flags in the group, {}, are set they must all be set; missing {}.".format( - keys.__str__(), - unset.__str__(), - ) - ) - - -fn validate_one_required_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: - """Validates that at least one flag in a group is set. - This is for flags that are marked as required via `Command().mark_flag_required()`. - - Args: - data: The dictionary of flag groups to validate. - - Raises: - Error: If an error occurred while validating the flag groups. - """ - # Check if at least one key is set. - for pair in data.items(): - var set = List[String]() - for flag in pair[].value.items(): - if flag[].value: - set.append(flag[].key) - - if len(set) >= 1: - continue - - # Sort values, so they can be tested/scripted against consistently. - # unset.sort() - var keys = List[String]() - for key in pair[].value.keys(): - keys.append(key[]) - - panic("At least one of the flags in the group {} is required.".format(keys.__str__())) - - -fn validate_mutually_exclusive_flag_group(data: Dict[String, Dict[String, Bool]]) raises -> None: - """Validates that only one flag in a group is set. - This is for flags that are marked as required via `Command().mark_flags_mutually_exclusive()`. - - Args: - data: The dictionary of flag groups to validate. - - Raises: - Error: If an error occurred while validating the flag groups. - """ - # Check if more than one mutually exclusive flag is set. - for pair in data.items(): - var set = List[String]() - for flag in pair[].value.items(): - if flag[].value: - set.append(flag[].key) - - if len(set) == 0 or len(set) == 1: - continue - - # Sort values, so they can be tested/scripted against consistently. - # unset.sort() - var keys = List[String]() - for key in pair[].value.keys(): - keys.append(key[]) - - panic( - "If any flags in the group {} are set none of the others can be; {} were all set.".format( - keys.__str__(), - set.__str__(), - ) - ) - - -fn validate_flag_groups( - group_status: Dict[String, Dict[String, Bool]], - one_required_group_status: Dict[String, Dict[String, Bool]], - mutually_exclusive_group_status: Dict[String, Dict[String, Bool]], -) raises -> None: - """Validates the status of flag groups. - Checks for flag groups that are required together, at least one required, and mutually exclusive. - Status is a map of maps containing the flag name and if it's been set. - - Args: - group_status: The status of flag groups that are required together. - one_required_group_status: The status of flag groups that require at least one flag to be set. - mutually_exclusive_group_status: The status of flag groups that are mutually exclusive. - - Raises: - Error: If an error occurred while validating the flag groups. - """ - validate_required_flag_group(group_status) - validate_one_required_flag_group(one_required_group_status) - validate_mutually_exclusive_flag_group(mutually_exclusive_group_status) - - -fn validate_flag_groups(flags: List[Flag]) raises -> None: - """Validates the status of flag groups. - - Args: - flags: The flags to validate. - - Raises: - Error: If an error occurred while validating the flag groups. - """ - var group_status = Dict[String, Dict[String, Bool]]() - var one_required_group_status = Dict[String, Dict[String, Bool]]() - var mutually_exclusive_group_status = Dict[String, Dict[String, Bool]]() - - @parameter - fn flag_checker(flag: Flag) raises -> None: - process_flag_for_group_annotation(flags, flag, REQUIRED_AS_GROUP, group_status) - process_flag_for_group_annotation(flags, flag, ONE_REQUIRED, one_required_group_status) - process_flag_for_group_annotation(flags, flag, MUTUALLY_EXCLUSIVE, mutually_exclusive_group_status) - - visit_all[flag_checker](flags) - - # Validate required flag groups - validate_flag_groups(group_status, one_required_group_status, mutually_exclusive_group_status) diff --git a/src/prism/flag_set.mojo b/src/prism/flag_set.mojo deleted file mode 100644 index d2b0794..0000000 --- a/src/prism/flag_set.mojo +++ /dev/null @@ -1,917 +0,0 @@ -from collections import Optional, Dict, InlineList -from utils import Variant -from memory import Pointer -from .flag import Flag, FlagActionFn -from .util import string_to_bool, split -from .flag_parser import FlagParser - - -alias FlagVisitorFn = fn (Flag) capturing -> None -"""Function perform some action while visiting all flags.""" -alias FlagVisitorRaisingFn = fn (Flag) capturing raises -> None -"""Function perform some action while visiting all flags. Can raise.""" - -# Individual flag annotations -alias REQUIRED = "REQUIRED" - -# Flag Group annotations -alias REQUIRED_AS_GROUP = "REQUIRED_AS_GROUP" -alias ONE_REQUIRED = "ONE_REQUIRED" -alias MUTUALLY_EXCLUSIVE = "MUTUALLY_EXCLUSIVE" - - -fn set_annotation(mut flags: List[Flag], name: String, key: String, values: String) raises -> None: - """Sets an annotation for a flag. - - Args: - flags: The flags to set the annotation for. - name: The name of the flag to set the annotation for. - key: The key of the annotation. - values: The values of the annotation. - - Raises: - Error: If setting the value for the annotation fails. - """ - # Annotation value can be a concatenated string of values. - # Why? Because we can have multiple required groups of flags for example. - # So each value of the list for the annotation can be a group of flag names. - var flag = lookup(flags, name) - try: - # TODO: remove running 2 lookups when ref can return a Pointer - # we can store as a without copying the result. - flag[].annotations[key].extend(values) - except: - flag[].annotations[key] = List[String](values) - - -fn set_required(mut flags: List[Flag], name: String) raises -> None: - """Sets a flag as required or not. - - Args: - flags: The flags to set the required flag for. - name: The name of the flag to set as required. - - Raises: - Error: If setting the value for the annotation fails. - """ - try: - set_annotation(flags, name, REQUIRED, "true") - except e: - print("FlagSet.set_required: Failed to set flag, {}, to required.".format(name), file=2) - raise e - - -fn set_as[annotation_type: String](mut flags: List[Flag], name: String, names: String) raises -> None: - """Sets a flag as a specific annotation type. - - Parameters: - annotation_type: The type of annotation to set. - - Args: - flags: The flags to set the annotation for. - name: The name of the flag to set the annotation for. - names: The values of the annotation. - - Raises: - Error: If the annotation type is not one of `REQUIRED_AS_GROUP`, `ONE_REQUIRED`, or `MUTUALLY_EXCLUSIVE`. - """ - constrained[ - annotation_type not in [REQUIRED_AS_GROUP, ONE_REQUIRED, MUTUALLY_EXCLUSIVE], - "annotation_type must be one of REQUIRED_AS_GROUP, ONE_REQUIRED, or MUTUALLY_EXCLUSIVE.", - ]() - try: - set_annotation(flags, name, annotation_type, names) - except e: - print( - "FlagSet.set_as: Failed to set flag, {}, with the following annotation: {}".format(name, annotation_type), - file=2, - ) - raise e - - -fn from_args(mut flags: List[Flag], arguments: List[String]) raises -> List[String]: - """Parses flags and args from the args passed via the command line and adds them to their appropriate collections. - - Args: - flags: The flags to parse. - arguments: The arguments passed via the command line. - - Returns: - The remaining arguments after parsing out flags. - - Raises: - Error: If a flag is not recognized. - """ - var parser = FlagParser() - return parser.parse(flags, arguments) - - -fn names(flags: List[Flag]) -> List[String]: - """Returns a list of names of all flags in the flag set. - - Args: - flags: The flags to get the names for. - - Returns: - A list of names of all flags in the flag set. - """ - var result = List[String](capacity=len(flags)) - for flag in flags: - result.append(flag[].name) - return result - - -fn shorthands(flags: List[Flag]) -> List[String]: - """Returns a list of shorthands of all flags in the flag set. - - Args: - flags: The flags to get the shorthands for. - - Returns: - A list of shorthands of all flags in the flag set. - """ - var result = List[String](capacity=len(flags)) - for flag in flags: - if flag[].shorthand: - result.append(flag[].shorthand) - return result - - -fn visit_all[visitor: FlagVisitorFn](flags: List[Flag]) -> None: - """Visits all flags in the flag set. - - Parameters: - visitor: The visitor function to call for each flag. - """ - for flag in flags: - visitor(flag[]) - - -fn visit_all[visitor: FlagVisitorRaisingFn](flags: List[Flag]) raises -> None: - """Visits all flags in the flag set. - - Parameters: - visitor: The visitor function to call for each flag. - - Raises: - Error: If the visitor raises an error. - """ - for flag in flags: - visitor(flag[]) - - -fn validate_required_flags(flags: List[Flag]) raises -> None: - """Validates all required flags are present and returns an error otherwise. - - Args: - flags: The flags to validate. - - Raises: - Error: If a required flag is not set. - """ - var missing_flag_names = List[String]() - - @parameter - fn check_required_flag(flag: Flag) -> None: - if flag.required and not flag.changed: - missing_flag_names.append(flag.name) - # var required_annotation = flag.annotations.get(REQUIRED, List[String]()) - # if required_annotation: - # if required_annotation[0] == "true" and not flag.changed: - # missing_flag_names.append(flag.name) - - visit_all[check_required_flag](flags) - - if len(missing_flag_names) > 0: - raise Error("Required flag(s): " + missing_flag_names.__str__() + " not set.") - - -fn lookup(ref flags: List[Flag], name: String, type: String = "") raises -> Pointer[Flag, __origin_of(flags)]: - """Returns an mutable or immutable Pointer to a Flag with the given name. - Mutable if FlagSet is mutable, immutable if FlagSet is immutable. - - Args: - flags: The flags to lookup. - name: The name of the Flag to lookup. - type: The type of the Flag to lookup. - - Returns: - Optional Pointer to the Flag. - - Raises: - Error: If the Flag is not found. - """ - if type == "": - for i in range(len(flags)): - if flags[i].name == name: - return Pointer.address_of(flags[i]) - else: - for i in range(len(flags)): - if flags[i].name == name and flags[i].type == type: - return Pointer.address_of(flags[i]) - - raise Error("FlagNotFoundError: Could not find the following flag: " + name) - - -fn lookup_name(flags: List[Flag], shorthand: String) raises -> String: - """Returns the name of a flag given its shorthand. - - Args: - flags: The flags to lookup. - shorthand: The shorthand of the flag to lookup. - - Returns: - The name of the flag. - - Raises: - Error: If the flag is not found. - """ - for flag in flags: - if flag[].shorthand and flag[].shorthand == shorthand: - return flag[].name - - raise Error("FlagNotFoundError: Could not find the following flag shorthand: " + shorthand) - - -fn string_flag( - name: String, - usage: String, - shorthand: String = "", - default: String = "", - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `String` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="String", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn bool_flag( - name: String, - usage: String, - shorthand: String = "", - default: Bool = False, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `Bool` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Bool", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn int_flag( - name: String, - usage: String, - shorthand: String = "", - default: Int = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds an `Int` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn int8_flag( - name: String, - usage: String, - shorthand: String = "", - default: Int8 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds an `Int8` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int8", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn int16_flag( - name: String, - usage: String, - shorthand: String = "", - default: Int16 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds an `Int16` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int16", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn int32_flag( - name: String, - usage: String, - shorthand: String = "", - default: Int32 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds an `Int32` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int32", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn int64_flag( - name: String, - usage: String, - shorthand: String = "", - default: Int64 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds an `Int64` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Int64", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn uint_flag( - name: String, - usage: String, - shorthand: String = "", - default: UInt8 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `UInt` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn uint8_flag( - name: String, - usage: String, - shorthand: String = "", - default: UInt8 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `UInt8` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt8", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn uint16_flag( - name: String, - usage: String, - shorthand: String = "", - default: UInt16 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `UInt16` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt16", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn uint32_flag( - name: String, - usage: String, - shorthand: String = "", - default: UInt32 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `UInt32` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt32", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn uint64_flag( - name: String, - usage: String, - shorthand: String = "", - default: UInt64 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `UInt64` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="UInt64", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn float16_flag( - name: String, - usage: String, - shorthand: String = "", - default: Float16 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `Float16` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Float16", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn float32_flag( - name: String, - usage: String, - shorthand: String = "", - default: Float32 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `Float32` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Float32", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn float64_flag( - name: String, - usage: String, - shorthand: String = "", - default: Float64 = 0, - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `Float64` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=str(default), - type="Float64", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn string_list_flag( - name: String, - usage: String, - shorthand: String = "", - default: List[String] = List[String](), - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `StringList` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=" ".join(default), - type="StringList", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn int_list_flag( - name: String, - usage: String, - shorthand: String = "", - default: List[Int, True] = List[Int, True](), - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `IntList` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=" ".join(default), - type="IntList", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) - - -fn float64_list_flag( - name: String, - usage: String, - shorthand: String = "", - default: List[Float64, True] = List[Float64, True](), - environment_variable: Optional[StringLiteral] = None, - file_path: Optional[StringLiteral] = None, - action: Optional[FlagActionFn] = None, - required: Bool = False, - persistent: Bool = False, -) -> Flag: - """Adds a `Float64List` flag to the flag set. - - Args: - name: The name of the flag. - usage: The usage of the flag. - shorthand: The shorthand of the flag. - default: The default value of the flag. - environment_variable: The environment variable to check for a value. - file_path: The file to check for a value. - action: Function to run after the flag has been processed. - required: If the flag is required. - persistent: If the flag should persist to children commands. - """ - return Flag( - name=name, - shorthand=shorthand, - usage=usage, - default=" ".join(default), - type="Float64List", - environment_variable=environment_variable, - file_path=file_path, - action=action, - required=required, - persistent=persistent, - ) diff --git a/test/test_command.mojo b/test/test_command.mojo index f1454ac..cc0e695 100644 --- a/test/test_command.mojo +++ b/test/test_command.mojo @@ -8,7 +8,7 @@ def test_command_operations(): fn dummy(ctx: Context) -> None: return None - cmd = Command( + var cmd = Command( name="root", usage="Base command.", run=dummy, diff --git a/test/test_flags.mojo b/test/test_flags.mojo index 0b85538..34c7438 100644 --- a/test/test_flags.mojo +++ b/test/test_flags.mojo @@ -2,9 +2,9 @@ from memory import ArcPointer import testing import prism from prism import Command, Context -from prism.flag import Flag -from prism.flag_set import string_to_bool, from_args -from prism.flag_parser import FlagParser +from prism.flag import Flag, string_flag, bool_flag, int_flag, int8_flag, int16_flag, int32_flag, int64_flag, uint_flag, uint8_flag, uint16_flag, uint32_flag, uint64_flag, float16_flag, float32_flag, float64_flag, string_list_flag, int_list_flag, float64_list_flag +from prism._flag_set import string_to_bool, from_args, lookup +from prism._flag_parser import FlagParser def test_string_to_bool(): @@ -77,3 +77,279 @@ def test_parse_shorthand_flag(): testing.assert_equal(name, "key") testing.assert_equal(value, "value") testing.assert_equal(increment_by, 1) + + +def test_string_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.string_flag(name="key", usage="usage", default="default"), + ), + ) + + var flag = lookup["String"](cmd.flags, "key") + testing.assert_equal(flag[].type, "String") + testing.assert_equal(cmd.get_string("key"), "default") + + +def test_bool_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.bool_flag(name="flag", usage="usage", default=False), + ), + ) + + var flag = lookup["Bool"](cmd.flags, "flag") + testing.assert_equal(flag[].type, "Bool") + testing.assert_equal(cmd.get_bool("flag"), False) + + +def test_int_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.int_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["Int"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Int") + testing.assert_equal(cmd.get_int("num"), 0) + + +def test_int8_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.int8_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["Int8"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Int8") + testing.assert_equal(cmd.get_int8("num"), Int8(0)) + + +def test_int16_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.int16_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["Int16"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Int16") + testing.assert_equal(cmd.get_int16("num"), Int16(0)) + + +def test_int32_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.int32_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["Int32"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Int32") + testing.assert_equal(cmd.get_int32("num"), Int32(0)) + + +def test_int64_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.int64_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["Int64"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Int64") + testing.assert_equal(cmd.get_int64("num"), Int64(0)) + + +def test_uint_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.uint_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["UInt"](cmd.flags, "num") + testing.assert_equal(flag[].type, "UInt") + testing.assert_equal(cmd.get_uint("num"), UInt(0)) + + +def test_uint8_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.uint8_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["UInt8"](cmd.flags, "num") + testing.assert_equal(flag[].type, "UInt8") + testing.assert_equal(cmd.get_uint8("num"), UInt8(0)) + + +def test_uint16_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.uint16_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["UInt16"](cmd.flags, "num") + testing.assert_equal(flag[].type, "UInt16") + testing.assert_equal(cmd.get_uint16("num"), UInt16(0)) + + +def test_uint32_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.uint32_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["UInt32"](cmd.flags, "num") + testing.assert_equal(flag[].type, "UInt32") + testing.assert_equal(cmd.get_uint32("num"), UInt32(0)) + + +def test_uint64_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.uint64_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["UInt64"](cmd.flags, "num") + testing.assert_equal(flag[].type, "UInt64") + testing.assert_equal(cmd.get_uint64("num"), UInt64(0)) + + +def test_float16_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.float16_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["Float16"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Float16") + testing.assert_equal(cmd.get_float16("num"), Float16(0)) + + +def test_float32_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.float32_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["Float32"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Float32") + testing.assert_equal(cmd.get_float32("num"), Float32(0)) + + +def test_float64_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.float64_flag(name="num", usage="usage", default=0), + ), + ) + + var flag = lookup["Float64"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Float64") + testing.assert_equal(cmd.get_float64("num"), Float64(0)) + + +def test_string_list_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.string_list_flag(name="num", usage="usage", default=List[String]("a", "b")), + ), + ) + + var flag = lookup["StringList"](cmd.flags, "num") + testing.assert_equal(flag[].type, "StringList") + testing.assert_equal(cmd.get_string_list("num"), List[String]("a", "b")) + + +def test_int_list_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.int_list_flag(name="num", usage="usage", default=List[Int, True](0, 1)), + ), + ) + + var flag = lookup["IntList"](cmd.flags, "num") + testing.assert_equal(flag[].type, "IntList") + + var result = cmd.get_int_list("num") + testing.assert_equal(result[0], 0) + testing.assert_equal(result[1], 1) + + +def test_float64_list_flag(): + var cmd = Command( + name="root", + usage="Base command.", + run=dummy, + flags=List[Flag]( + prism.float64_list_flag(name="num", usage="usage", default=List[Float64, True](0, 1)), + ), + ) + + var flag = lookup["Float64List"](cmd.flags, "num") + testing.assert_equal(flag[].type, "Float64List") + + var result = cmd.get_float64_list("num") + testing.assert_equal(result[0], Float64(0)) + testing.assert_equal(result[1], Float64(1)) From fcd6ce602256df0e6dbec96e220b141c68447447 Mon Sep 17 00:00:00 2001 From: Mikhail Tavarez Date: Thu, 2 Jan 2025 14:43:47 -0600 Subject: [PATCH 6/7] cleaning up readme now --- README.md | 49 +++++++++++++++++++-------------- src/prism/_flag_set.mojo | 8 ++---- src/prism/command.mojo | 57 ++++++++++++++------------------------ src/prism/flag.mojo | 59 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 0bc225e..875bdb1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A Budding CLI Library! Inspired by: `Cobra` and `urfave/cli`! -![Mojo Version](https://img.shields.io/badge/Mojo%F0%9F%94%A5-24.5-orange) +![Mojo Version](https://img.shields.io/badge/Mojo%F0%9F%94%A5-24.6-orange) ![Build Status](https://github.com/thatstoasty/prism/actions/workflows/build.yml/badge.svg) ![Test Status](https://github.com/thatstoasty/prism/actions/workflows/test.yml/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) @@ -55,21 +55,23 @@ fn main() -> None: name="hello", description="This is a dummy command!", run=test, + children=List[ArcPointer[Command]]( + ArcPointer(Command( + name="chromeria", + description="This is a dummy command!", + run=hello + )) + ), ) - hello_command = Arc(Command(name="chromeria", description="This is a dummy command!", run=hello)) - - root.add_subcommand(hello_command) root.execute() ``` ![Chromeria](https://github.com/thatstoasty/prism/blob/main/doc/tapes/hello-chromeria.gif) -## Why are subcommands wrapped with `Arc`? - -Due to the nature of self-referential structs, we need to use a smart pointer to reference the subcommand. The child command is owned by the `Arc` pointer, and that pointer is then shared across the program execution. +## Why are subcommands wrapped with `ArcPointer`? -This will be changed to `Box` in the upcoming release. +Due to the nature of self-referential structs, we need to use a smart pointer to reference the subcommand. The child command is owned by the `ArcPointer`, and that pointer is then shared across the program execution. ## Accessing arguments @@ -89,7 +91,7 @@ fn printer(ctx: Context) raises -> None: Commands can also be aliased to enable different ways to call the same command. You can change the command underneath the alias and maintain the same behavior. ```mojo -print_tool = Arc(Command( +print_tool = ArcPointer(Command( name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") )) ``` @@ -139,7 +141,7 @@ Flag values can also be retrieved from environment variables, if a value is not ```mojo fn test(ctx: Context) raises -> None: - name = ctx.command[].flags.get_string("name") + name = ctx.command[].get_string("name") print(String("Hello {}").format(name)) @@ -166,8 +168,8 @@ Likewise, flag values can also be retrieved from a file as well, if a value is n ```mojo fn test(ctx: Context) raises -> None: - name = ctx.command[].flags.get_string("name") - print(String("Hello {}").format(name)) + name = ctx.command[].get_string("name") + print("Hello {}".format(name)) fn main() -> None: @@ -204,14 +206,14 @@ Flags and hooks can also be inherited by children commands! This can be useful f fn main() -> None: root = Command(name="nested", description="Base command.", run=base) - get_command = Arc(Command( + get_command = ArcPointer(Command( name="get", description="Base command for getting some data.", run=print_information, persistent_pre_run=pre_hook, persistent_post_run=post_hook, )) - get_command[].flags.persistent_flags.bool_flag(name="lover", shorthand="l", usage="Are you an animal lover?") + get_command[].bool_flag(name="lover", shorthand="l", usage="Are you an animal lover?") ``` ![Persistent](https://github.com/thatstoasty/prism/blob/main/doc/tapes/persistent.gif) @@ -223,7 +225,7 @@ Flags can be grouped together to enable relationships between them. This can be By default flags are considered optional. If you want your command to report an error when a flag has not been set, mark it as required: ```mojo -print_tool = Arc(Command( +print_tool = ArcPointer(Command( name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") )) print_tool[].flags.bool_flag(name="required", shorthand="r", usage="Always required.") @@ -247,7 +249,7 @@ Same for persistent flags: If you have different flags that must be provided together (e.g. if they provide the `--color` flag they MUST provide the `--formatting` flag as well) then Prism can enforce that requirement: ```mojo - print_tool = Arc(Command( + print_tool = ArcPointer(Command( name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") )) print_tool[].flags.uint32_flag(name="color", shorthand="c", usage="Text color", default=0x3464eb) @@ -258,7 +260,7 @@ If you have different flags that must be provided together (e.g. if they provide You can also prevent different flags from being provided together if they represent mutually exclusive options such as specifying an output format as either `--color` or `--hue` but never both: ```mojo - print_tool = Arc(Command( + print_tool = ArcPointer(Command( name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") )) print_tool[].string_flag(name="color", shorthand="c", usage="Text color", default="#3464eb") @@ -269,7 +271,7 @@ You can also prevent different flags from being provided together if they repres If you want to require at least one flag from a group to be present, you can use `mark_flags_one_required`. This can be combined with `mark_flags_mutually_exclusive` to enforce exactly one flag from a given group: ```mojo - print_tool = Arc(Command( + print_tool = ArcPointer(Command( name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") )) print_tool[].flags.string_flag(name="color", shorthand="c", usage="Text color", default="#3464eb") @@ -304,7 +306,7 @@ fn main() -> None: root.persistent_flags.string_flag(name="port", shorthand="p", usage="Port") root.mark_persistent_flag_required("required") - print_tool = Arc(Command( + print_tool = ArcPointer(Command( name="tool", description="This is a dummy command!", run=tool_func )) print_tool[].flags.bool_flag(name="also", shorthand="a", usage="Also always required.") @@ -338,6 +340,8 @@ Validation of positional arguments can be specified using the `arg_validator` fi - `range_args[min, max]` - report an error if the number of args is not between min and max. - Content of the arguments: - `valid_args` - report an error if there are any positional args not specified in the `valid_args` field of `Command`, which can optionally be set to a list of valid values for positional args. +- Composition of validators: + - `match_all` - pass a list of validators to ensure all of them pass. If `arg_validator` is undefined, it defaults to `arbitrary_args`. @@ -348,7 +352,7 @@ If `arg_validator` is undefined, it defaults to `arbitrary_args`. Commands are configured to accept a `--help` flag by default. This will print the output of a default help function. You can also configure a custom help function to be run when the `--help` flag is passed. ```mojo -fn help_func(inout command: Arc[Command]) -> String: +fn help_func(mut command: ArcPointer[Command]) -> String: return "My help function." fn main() -> None: @@ -378,11 +382,14 @@ fn main() -> None: - Add support for combining shorthand flags, like so: `-abc` instead of `-a -b -c`. - Try to avoid `Dict` and `try/except` blocks in order to support compile time command building. - Add persistent flag mutually exclusive and required together checks back in. +- Add version flag and version function, like with `help`. +- Use os exiting function, instead of just panicking. This will let users handle the case where we normally just panic. +- Add support for stdout/stderr writer configuration, instead of just using print. ## Improvements - Tree traversal improvements. -- `ArcPointer[Command]` being passed to validators and command functions is marked as inout because the compiler complains about forming a reference to a borrowed register value. This is a temporary fix, I will try to get it back to a borrowed reference. +- `ArcPointerPointer[Command]` being passed to validators and command functions is marked as mut because the compiler complains about forming a reference to a borrowed register value. This is a temporary fix, I will try to get it back to a borrowed reference. - For now, help functions and arg validators will need to be set after the command is constructed. This is to help reduce cyclical dependencies, but I will work on a way to set these values in the constructor as the type system matures. - Once we have trait objects, use actual typed flags instead of converting values to and from strings. diff --git a/src/prism/_flag_set.mojo b/src/prism/_flag_set.mojo index 2030fd3..d0765f7 100644 --- a/src/prism/_flag_set.mojo +++ b/src/prism/_flag_set.mojo @@ -1,7 +1,7 @@ from collections import Optional, Dict, InlineList from utils import Variant from memory import Pointer -from .flag import Flag, FlagActionFn +from .flag import Flag, FlagActionFn, FType from ._util import string_to_bool, split from ._flag_parser import FlagParser @@ -179,17 +179,13 @@ fn lookup[type: String = ""](ref flags: List[Flag], name: String) raises -> Poin Raises: Error: If the Flag is not found. """ - constrained[ - type not in ["String", "Bool", "Int", "Int8", "Int16", "Int32", "Int64", "UInt", "UInt8", "UInt16", "UInt32", "UInt64", "Float16", "Float32", "Float64", "StringList", "IntList", "Float64List"], - "type must be one of `String`, `Bool`, `Int`, `Int8`, `Int16`, `Int32`, `Int64`, `UInt`, `UInt8`, `UInt16`, `UInt32`, `UInt64`, `Float16`, `Float32`, `Float64`, `StringList`, `IntList`, `Float64List`.", - ]() + constrained[type not in FType.ValidTypes, "type must be one of `String`, `Bool`, `Int`, `Int8`, `Int16`, `Int32`, `Int64`, `UInt`, `UInt8`, `UInt16`, `UInt32`, `UInt64`, `Float16`, `Float32`, `Float64`, `StringList`, `IntList`, `Float64List`."]() if type == "": for i in range(len(flags)): if flags[i].name == name: return Pointer.address_of(flags[i]) else: for i in range(len(flags)): - print(flags[i].name, name, flags[i].name == name, flags[i].type, type, flags[i].type == type) if flags[i].name == name and flags[i].type == type: return Pointer.address_of(flags[i]) diff --git a/src/prism/command.mojo b/src/prism/command.mojo index 2a065b5..39f6db2 100644 --- a/src/prism/command.mojo +++ b/src/prism/command.mojo @@ -3,7 +3,7 @@ from collections import Optional, Dict, InlineList from memory import ArcPointer import mog from ._util import to_string, to_list, string_to_bool, panic -from .flag import Flag, bool_flag +from .flag import Flag, FType, bool_flag from ._flag_set import ( visit_all, validate_required_flags, @@ -623,18 +623,6 @@ struct Command(CollectionElement, Writable, Stringable): """Returns all flags for the command and inherited flags from its parent.""" self.flags += self.inherited_flags() - # fn add_subcommand(mut self, mut command: ArcPointer[Self]): - # """Adds child command and set's child's parent attribute to self. - - # Args: - # command: The command to add as a child of self. - # """ - # self.children.append(command) - # if command[].parent: - # command[].parent[0] = self - # else: - # command[].parent.append(self) - fn _mark_flag_group_as[annotation: String](mut self, flag_names: List[String]) -> None: """Marks the given flags with annotations so that `Prism` errors @@ -690,7 +678,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return lookup["String"](self.flags, name)[].value_or_default() + return lookup[FType.String](self.flags, name)[].value_or_default() fn get_bool(self, name: String) raises -> Bool: """Returns the value of a flag as a `Bool`. If it isn't set, then return the default value. @@ -721,10 +709,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - constrained[ - type not in ["Int", "Int8", "Int16", "Int32", "Int64", "UInt", "UInt8", "UInt16", "UInt32", "UInt64"], - "type must be one of `Int`, `Int8`, `Int16`, `Int32`, `Int64`, `UInt`, `UInt8`, `UInt16`, `UInt32`, or `UInt64`.", - ]() + constrained[type not in FType.IntTypes, "type must be one of `Int`, `Int8`, `Int16`, `Int32`, `Int64`, `UInt`, `UInt8`, `UInt16`, `UInt32`, or `UInt64`."]() return atol(lookup[type](self.flags, name)[].value_or_default()) fn get_int8(self, name: String) raises -> Int8: @@ -739,7 +724,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return Int8(self.get_int["Int8"](name)) + return Int8(self.get_int[FType.Int8](name)) fn get_int16(self, name: String) raises -> Int16: """Returns the value of a flag as a `Int16`. If it isn't set, then return the default value. @@ -753,7 +738,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return Int16(self.get_int["Int16"](name)) + return Int16(self.get_int[FType.Int16](name)) fn get_int32(self, name: String) raises -> Int32: """Returns the value of a flag as a `Int32`. If it isn't set, then return the default value. @@ -767,7 +752,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return Int32(self.get_int["Int32"](name)) + return Int32(self.get_int[FType.Int32](name)) fn get_int64(self, name: String) raises -> Int64: """Returns the value of a flag as a `Int64`. If it isn't set, then return the default value. @@ -781,7 +766,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return Int64(self.get_int["Int64"](name)) + return Int64(self.get_int[FType.Int64](name)) fn get_uint(self, name: String) raises -> UInt: """Returns the value of a flag as a `UInt`. If it isn't set, then return the default value. @@ -795,7 +780,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt(self.get_int["UInt"](name)) + return UInt(self.get_int[FType.UInt](name)) fn get_uint8(self, name: String) raises -> UInt8: """Returns the value of a flag as a `UInt8`. If it isn't set, then return the default value. @@ -809,7 +794,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt8(self.get_int["UInt8"](name)) + return UInt8(self.get_int[FType.UInt8](name)) fn get_uint16(self, name: String) raises -> UInt16: """Returns the value of a flag as a `UInt16`. If it isn't set, then return the default value. @@ -823,7 +808,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt16(self.get_int["UInt16"](name)) + return UInt16(self.get_int[FType.UInt16](name)) fn get_uint32(self, name: String) raises -> UInt32: """Returns the value of a flag as a `UInt32`. If it isn't set, then return the default value. @@ -837,7 +822,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt32(self.get_int["UInt32"](name)) + return UInt32(self.get_int[FType.UInt32](name)) fn get_uint64(self, name: String) raises -> UInt64: """Returns the value of a flag as a `UInt64`. If it isn't set, then return the default value. @@ -851,7 +836,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return UInt64(self.get_int["UInt64"](name)) + return UInt64(self.get_int[FType.UInt64](name)) fn get_float[type: String](self, name: String) raises -> Float64: """Returns the value of a flag as a `Float64`. If it isn't set, then return the default value. @@ -868,6 +853,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ + constrained[type not in FType.FloatTypes, "type must be one of `Float16`, `Float32`, `Float64`"]() return atof(lookup[type](self.flags, name)[].value_or_default()) fn get_float16(self, name: String) raises -> Float16: @@ -882,7 +868,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self.get_float["Float16"](name).cast[DType.float16]() + return self.get_float[FType.Float16](name).cast[DType.float16]() fn get_float32(self, name: String) raises -> Float32: """Returns the value of a flag as a `Float32`. If it isn't set, then return the default value. @@ -896,7 +882,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self.get_float["Float32"](name).cast[DType.float32]() + return self.get_float[FType.Float32](name).cast[DType.float32]() fn get_float64(self, name: String) raises -> Float64: """Returns the value of a flag as a `Float64`. If it isn't set, then return the default value. @@ -910,7 +896,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self.get_float["Float64"](name) + return self.get_float[FType.Float64](name) fn _get_list[type: String](self, name: String) raises -> List[String]: """Returns the value of a flag as a `List[String]`. If it isn't set, then return the default value. @@ -927,10 +913,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - constrained[ - type not in ["StringList", "IntList", "Float64List"], - "type must be one of `StringList`, `IntList`, or `Float64List`.", - ]() + constrained[type not in FType.ListTypes, "type must be one of `StringList`, `IntList`, or `Float64List`."]() return lookup[type](self.flags, name)[].value_or_default().split(sep=" ") fn get_string_list(self, name: String) raises -> List[String]: @@ -945,7 +928,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - return self._get_list["StringList"](name) + return self._get_list[FType.StringList](name) fn get_int_list(self, name: String) raises -> List[Int]: """Returns the value of a flag as a `List[Int]`. If it isn't set, then return the default value. @@ -959,7 +942,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - var values = self._get_list["IntList"](name) + var values = self._get_list[FType.IntList](name) var ints = List[Int](capacity=len(values)) for value in values: ints.append(atol(value[])) @@ -977,7 +960,7 @@ struct Command(CollectionElement, Writable, Stringable): Raises: Error: If the flag is not found. """ - var values = self._get_list["Float64List"](name) + var values = self._get_list[FType.Float64List](name) var floats = List[Float64](capacity=len(values)) for value in values: floats.append(atof(value[])) diff --git a/src/prism/flag.mojo b/src/prism/flag.mojo index e66378c..93701ab 100644 --- a/src/prism/flag.mojo +++ b/src/prism/flag.mojo @@ -4,6 +4,65 @@ alias FlagActionFn = fn (ctx: Context, value: String) raises -> None """The type of a function that runs after a flag has been processed.""" +@value +@register_passable("trivial") +struct FType(): + """Flag types enum helper.""" + alias String = "String" + alias Bool = "Bool" + alias Int = "Int" + alias Int8 = "Int8" + alias Int16 = "Int16" + alias Int32 = "Int32" + alias Int64 = "Int64" + alias UInt = "UInt" + alias UInt8 = "UInt8" + alias UInt16 = "UInt16" + alias UInt32 = "UInt32" + alias UInt64 = "UInt64" + alias Float16 = "Float16" + alias Float32 = "Float32" + alias Float64 = "Float64" + alias StringList = "StringList" + alias IntList = "IntList" + alias Float64List = "Float64List" + + alias IntTypes = [ + Self.Int, + Self.Int8, + Self.Int16, + Self.Int32, + Self.Int64, + Self.UInt, + Self.UInt8, + Self.UInt16, + Self.UInt32, + Self.UInt64, + ] + alias FloatTypes = [Self.Float16, Self.Float32, Self.Float64] + alias ListTypes = [Self.StringList, Self.IntList, Self.Float64List] + alias ValidTypes = [ + Self.String, + Self.Bool, + Self.Int, + Self.Int8, + Self.Int16, + Self.Int32, + Self.Int64, + Self.UInt, + Self.UInt8, + Self.UInt16, + Self.UInt32, + Self.UInt64, + Self.Float16, + Self.Float32, + Self.Float64, + Self.StringList, + Self.IntList, + Self.Float64List, + ] + + # TODO: When we have trait objects, switch to using actual flag structs per type instead of # needing to cast values to and from string. @value From bdc2824ecdf35157bdea88f5bd000bec3e86a936 Mon Sep 17 00:00:00 2001 From: Mikhail Tavarez Date: Thu, 2 Jan 2025 16:38:24 -0600 Subject: [PATCH 7/7] update changelog and readme --- CHANGELOG.md | 6 + README.md | 271 ++++++++++++++++++----------- examples/printer/mojoproject.toml | 2 +- examples/requests/mojoproject.toml | 2 +- mojoproject.toml | 2 +- 5 files changed, 181 insertions(+), 102 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe46bf..e4cc8ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - yyyy-mm-dd +## [0.3.0] - 2024-01-02 + +- Refactored the `Command` API to define everything up front similar to `urfave/cli`. + - This is a big change to how the library works, users should review the examples and readme to see how to use the new API. +- Removed usage of the `FlagSet` struct and moved to functions that operate on `List[Flag]`. + ## [0.2.1] - 2024-11-02 - Added environment variable and file path support for flags. diff --git a/README.md b/README.md index 875bdb1..aa91fc7 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,8 @@ Due to the nature of self-referential structs, we need to use a smart pointer to `prism` provides the parsed arguments as part of the `ctx` argument. ```mojo +from prism import Context + fn printer(ctx: Context) raises -> None: if len(ctx.args) == 0: raise Error("No args provided.") @@ -91,8 +93,15 @@ fn printer(ctx: Context) raises -> None: Commands can also be aliased to enable different ways to call the same command. You can change the command underneath the alias and maintain the same behavior. ```mojo -print_tool = ArcPointer(Command( - name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") +from memory import ArcPointer +from prism import Command + +fn main(): + print_tool = ArcPointer(Command( + name="tool", + description="This is a dummy command!", + run=tool_func, + aliases=List[String]("object", "thing") )) ``` @@ -103,6 +112,8 @@ print_tool = ArcPointer(Command( Commands can be configured to run pre-hook and post-hook functions before and after the command's main run function. ```mojo +from prism import Command, Context + fn pre_hook(ctx: Context) -> None: print("Pre-hook executed!") @@ -126,11 +137,23 @@ fn main() -> None: Commands can have typed flags added to them to enable different behaviors. ```mojo +from memory import ArcPointer +from prism import Command, Flag +import prism + fn main() -> None: root = Command( - name="logger", description="Base command.", run=handler + name="logger", + description="Base command.", + run=handler, + flags=List[Flag]( + prism.string_flag( + name="type", + shorthand="t", + usage="Formatting type: [json, custom]", + ) + ), ) - root.flags.string_flag(name="type", shorthand="t", usage="Formatting type: [json, custom]") ``` ![Logging](https://github.com/thatstoasty/prism/blob/main/doc/tapes/logging.gif) @@ -140,9 +163,13 @@ fn main() -> None: Flag values can also be retrieved from environment variables, if a value is not provided as an argument. ```mojo +from memory import ArcPointer +from prism import Command, Flag +import prism + fn test(ctx: Context) raises -> None: name = ctx.command[].get_string("name") - print(String("Hello {}").format(name)) + print("Hello {}".format(name)) fn main() -> None: @@ -150,13 +177,14 @@ fn main() -> None: name="greet", usage="Greet a user!", raising_run=test, - ) - - root.flags.string_flag( - name="name", - shorthand="n", - usage="The name of the person to greet.", - environment_variable="NAME", + flags=List[Flag]( + prism.string_flag( + name="name", + shorthand="n", + usage="The name of the person to greet.", + environment_variable="NAME", + ) + ), ) root.execute() @@ -167,23 +195,27 @@ fn main() -> None: Likewise, flag values can also be retrieved from a file as well, if a value is not provided as an argument. ```mojo +from memory import ArcPointer +from prism import Command, Flag +import prism + fn test(ctx: Context) raises -> None: name = ctx.command[].get_string("name") print("Hello {}".format(name)) - fn main() -> None: root = Command( name="greet", usage="Greet a user!", raising_run=test, - ) - - root.flags.string_flag( - name="name", - shorthand="n", - usage="The name of the person to greet.", - file_path="~/.myapp/config", + flags=List[Flag]( + prism.string_flag( + name="name", + shorthand="n", + usage="The name of the person to greet.", + file_path="~/.myapp/config", + ) + ), ) root.execute() @@ -203,17 +235,33 @@ The precedence for flag value sources is as follows (highest to lowest): Flags and hooks can also be inherited by children commands! This can be useful for setting global flags or hooks that should be applied to all child commands. ```mojo +from memory import ArcPointer +from prism import Command, Flag +import prism + fn main() -> None: - root = Command(name="nested", description="Base command.", run=base) - - get_command = ArcPointer(Command( - name="get", - description="Base command for getting some data.", - run=print_information, - persistent_pre_run=pre_hook, - persistent_post_run=post_hook, - )) - get_command[].bool_flag(name="lover", shorthand="l", usage="Are you an animal lover?") + root = Command( + name="nested", + description="Base command.", + run=base, + children=List[ArcPointer[Command]]( + ArcPointer(Command( + name="get", + description="Base command for getting some data.", + run=print_information, + persistent_pre_run=pre_hook, + persistent_post_run=post_hook, + )) + ), + flags=List[Flag]( + prism.bool_flag( + name="lover", + shorthand="l", + usage="Are you an animal lover?", + persistent=True, + ) + ), + ) ``` ![Persistent](https://github.com/thatstoasty/prism/blob/main/doc/tapes/persistent.gif) @@ -225,23 +273,25 @@ Flags can be grouped together to enable relationships between them. This can be By default flags are considered optional. If you want your command to report an error when a flag has not been set, mark it as required: ```mojo -print_tool = ArcPointer(Command( - name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") - )) - print_tool[].flags.bool_flag(name="required", shorthand="r", usage="Always required.") - print_tool[].mark_flag_required("required") -``` - -Same for persistent flags: +from memory import ArcPointer +from prism import Command, Flag +import prism -```mojo - root = Command( - name="my", +fn main(): + print_tool = ArcPointer(Command( + name="tool", description="This is a dummy command!", - run=test, - ) - root.persistent_flags.bool_flag(name="free", shorthand="f", usage="Always required.") - root.mark_persistent_flag_required("free") + run=tool_func, + aliases=List[String]("object", "thing"), + flags=List[Flag]( + prism.bool_flag( + name="required", + shorthand="r", + usage="Always required.", + required=True, + ) + ), + )) ``` ### Flag Groups @@ -249,84 +299,103 @@ Same for persistent flags: If you have different flags that must be provided together (e.g. if they provide the `--color` flag they MUST provide the `--formatting` flag as well) then Prism can enforce that requirement: ```mojo +from memory import ArcPointer +from prism import Command, Flag +import prism + +fn main();: print_tool = ArcPointer(Command( - name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") + name="tool", + description="This is a dummy command!", + run=tool_func, + aliases=List[String]("object", "thing"), + flags=List[Flag]( + prism.uint32_flag( + name="color", + shorthand="c", + usage="Text color", + default=0x3464eb, + ), + prism.string_flag( + name="formatting", + shorthand="f", + usage="Text formatting", + ), + ), + flags_required_together=List[String]("color", "formatting"), )) - print_tool[].flags.uint32_flag(name="color", shorthand="c", usage="Text color", default=0x3464eb) - print_tool[].flags.string_flag(name="formatting", shorthand="f", usage="Text formatting") - print_tool[].mark_flags_required_together("color", "formatting") ``` You can also prevent different flags from being provided together if they represent mutually exclusive options such as specifying an output format as either `--color` or `--hue` but never both: ```mojo +from memory import ArcPointer +from prism import Command, Flag +import prism + +fn main(): print_tool = ArcPointer(Command( - name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") + name="tool", + description="This is a dummy command!", + run=tool_func, + aliases=List[String]("object", "thing"), + flags=List[Flag]( + prism.uint32_flag( + name="color", + shorthand="c", + usage="Text color", + default=0x3464eb, + ), + prism.uint32_flag( + name="hue", + shorthand="x", + usage="Text color", + default="#3464eb", + ), + ), + mutually_exclusive_flags=List[String]("color", "hue"), )) - print_tool[].string_flag(name="color", shorthand="c", usage="Text color", default="#3464eb") - print_tool[].string_flag(name="hue", shorthand="x", usage="Text color", default="#3464eb") - print_tool[].mark_flags_mutually_exclusive("color", "hue") ``` If you want to require at least one flag from a group to be present, you can use `mark_flags_one_required`. This can be combined with `mark_flags_mutually_exclusive` to enforce exactly one flag from a given group: ```mojo +from memory import ArcPointer +from prism import Command, Flag +import prism + +fn main(): print_tool = ArcPointer(Command( - name="tool", description="This is a dummy command!", run=tool_func, aliases=List[String]("object", "thing") + name="tool", + description="This is a dummy command!", + run=tool_func, + aliases=List[String]("object", "thing"), + flags=List[Flag]( + prism.uint32_flag( + name="color", + shorthand="c", + usage="Text color", + default=0x3464eb, + ), + prism.string_flag( + name="formatting", + shorthand="f", + usage="Text formatting", + ), + ), + one_required_flags=List[String]("color", "formatting"), + mutually_exclusive_flags=List[String]("color", "formatting"), )) - print_tool[].flags.string_flag(name="color", shorthand="c", usage="Text color", default="#3464eb") - print_tool[].flags.string_flag(name="formatting", shorthand="f", usage="Text formatting") - print_tool[].mark_flags_one_required("color", "formatting") - print_tool[].mark_flags_mutually_exclusive("color", "formatting") ``` In these cases: -- Both local and persistent flags can be used. - - NOTE: the group is only enforced on commands where every flag is defined. +- The group is only enforced on commands where every flag is defined. - A flag may appear in multiple groups. - A group may contain any number of flags. ![Flag Groups](https://github.com/thatstoasty/prism/blob/main/doc/tapes/flag_groups.gif) -> NOTE: If you want to enforce a rule on persistent flags, then the child command must be added to the parent command **BEFORE** setting the rule. - -See `examples/flag_groups/child.mojo` for an example. - -```mojo -fn main() -> None: - root = Command( - name="my", - description="This is a dummy command!", - run=test, - ) - # Persistent flags are defined on the parent command. - root.persistent_flags.bool_flag(name="required", shorthand="r", usage="Always required.") - root.persistent_flags.string_flag(name="host", shorthand="h", usage="Host") - root.persistent_flags.string_flag(name="port", shorthand="p", usage="Port") - root.mark_persistent_flag_required("required") - - print_tool = ArcPointer(Command( - name="tool", description="This is a dummy command!", run=tool_func - )) - print_tool[].flags.bool_flag(name="also", shorthand="a", usage="Also always required.") - print_tool[].flags.string_flag(name="uri", shorthand="u", usage="URI") - - # Child commands are added to the parent command. - root.add_subcommand(print_tool) - - # Rules are set on the child command, which can include persistent flags inherited from the parent command. - # When executing `mark_flags_required_together()` or `mark_flags_mutually_exclusive()`, - # the inherited flags from all parents will merged into the print_tool[].flags FlagSet. - print_tool[].mark_flag_required("also") - print_tool[].mark_flags_required_together("host", "port") - print_tool[].mark_flags_mutually_exclusive("host", "uri") - - root.execute() -``` - -![Flag Groups 2](https://github.com/thatstoasty/prism/blob/main/doc/tapes/flag_groups-2.gif) - ## Positional and Custom Arguments Validation of positional arguments can be specified using the `arg_validator` field of `Command`. The following validators are built in: @@ -352,6 +421,10 @@ If `arg_validator` is undefined, it defaults to `arbitrary_args`. Commands are configured to accept a `--help` flag by default. This will print the output of a default help function. You can also configure a custom help function to be run when the `--help` flag is passed. ```mojo +from memory import ArcPointer +from prism import Command +import prism + fn help_func(mut command: ArcPointer[Command]) -> String: return "My help function." @@ -389,7 +462,7 @@ fn main() -> None: ## Improvements - Tree traversal improvements. -- `ArcPointerPointer[Command]` being passed to validators and command functions is marked as mut because the compiler complains about forming a reference to a borrowed register value. This is a temporary fix, I will try to get it back to a borrowed reference. +- `ArcPointer[Command]` being passed to validators and command functions is marked as `mut` because the compiler complains about forming a reference to a borrowed register value. This is a temporary fix, I will try to get it back to a borrowed reference. - For now, help functions and arg validators will need to be set after the command is constructed. This is to help reduce cyclical dependencies, but I will work on a way to set these values in the constructor as the type system matures. - Once we have trait objects, use actual typed flags instead of converting values to and from strings. diff --git a/examples/printer/mojoproject.toml b/examples/printer/mojoproject.toml index 48b95e9..586df3b 100644 --- a/examples/printer/mojoproject.toml +++ b/examples/printer/mojoproject.toml @@ -11,4 +11,4 @@ version = "0.1.0" [dependencies] max = ">=24.6.0" mist = ">=0.1.9" -prism = ">=0.2.2" +prism = ">=0.3.0" diff --git a/examples/requests/mojoproject.toml b/examples/requests/mojoproject.toml index 542fb8d..dc615b5 100644 --- a/examples/requests/mojoproject.toml +++ b/examples/requests/mojoproject.toml @@ -10,5 +10,5 @@ version = "0.1.0" [dependencies] max = ">=24.6.0" -prism = ">=0.2.2" +prism = ">=0.3.0" requests = ">=2.32.3,<3" diff --git a/mojoproject.toml b/mojoproject.toml index 80ae59f..4efe40f 100644 --- a/mojoproject.toml +++ b/mojoproject.toml @@ -4,7 +4,7 @@ channels = ["https://repo.prefix.dev/mojo-community", "conda-forge", "https://co description = "A Budding CLI Library!" name = "prism" platforms = ["osx-arm64", "linux-64"] -version = "0.2.2" +version = "0.3.0" license = "MIT" license-file = "LICENSE" homepage = "https://github.com/thatstoasty/prism"