From c711f6683d903e9129919829c08853ee1d9178ff Mon Sep 17 00:00:00 2001 From: Elijah Rippeth Date: Fri, 14 Jan 2022 08:44:12 -0500 Subject: [PATCH 1/3] since we no longer support python 3.6, we get dataclasses in stdlib for free. --- .circleci/unittest/linux/scripts/environment.yml | 1 - .circleci/unittest/windows/scripts/environment.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml index 363e3085e1..d17cb483e1 100644 --- a/.circleci/unittest/linux/scripts/environment.yml +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -5,7 +5,6 @@ dependencies: - codecov - pip - pip: - - dataclasses - nltk - requests - revtok diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml index dc9889b588..08baccfb41 100644 --- a/.circleci/unittest/windows/scripts/environment.yml +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -5,7 +5,6 @@ dependencies: - codecov - pip - pip: - - dataclasses - nltk - requests - revtok From 3689b3900be6a01fd682633e812aebaf04450880 Mon Sep 17 00:00:00 2001 From: Elijah Rippeth Date: Fri, 14 Jan 2022 08:49:15 -0500 Subject: [PATCH 2/3] replace pip-install of packages with conda-install where applicable for better version management of native code. --- .../unittest/linux/scripts/environment.yml | 21 +++++++++-------- .../unittest/windows/scripts/environment.yml | 23 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml index d17cb483e1..b84b9b92e5 100644 --- a/.circleci/unittest/linux/scripts/environment.yml +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -1,21 +1,24 @@ channels: - defaults + - conda-forge dependencies: - flake8>=3.7.9 - codecov - pip + - nltk + - requests + - pytest + - pytest-cov + - sacremoses + - spacy>=3.0 + - sphinx + - tqdm + - certifi + - future + - expecttest - pip: - - nltk - - requests - revtok - - pytest - - pytest-cov - pytest-pythonpath - - sacremoses - - spacy - - sphinx - sphinx-rtd-theme - - tqdm - - expecttest - https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-3.0.0/de_core_news_sm-3.0.0.tar.gz#egg=de_core_news_sm==3.0.0 - https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz#egg=en_core_web_sm==3.0.0 diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml index 08baccfb41..b84b9b92e5 100644 --- a/.circleci/unittest/windows/scripts/environment.yml +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -1,23 +1,24 @@ channels: - defaults + - conda-forge dependencies: - flake8>=3.7.9 - codecov - pip + - nltk + - requests + - pytest + - pytest-cov + - sacremoses + - spacy>=3.0 + - sphinx + - tqdm + - certifi + - future + - expecttest - pip: - - nltk - - requests - revtok - - pytest - - pytest-cov - pytest-pythonpath - - sacremoses - - spacy - - sphinx - sphinx-rtd-theme - - tqdm - - certifi - - future - - expecttest - https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-3.0.0/de_core_news_sm-3.0.0.tar.gz#egg=de_core_news_sm==3.0.0 - https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz#egg=en_core_web_sm==3.0.0 From 774093fb9bd77f888e9e93ef07cf117d7b8b302e Mon Sep 17 00:00:00 2001 From: Elijah Rippeth Date: Fri, 14 Jan 2022 15:29:59 -0500 Subject: [PATCH 3/3] make cpuonly a constraint instead of feature --- packaging/pkg_helpers.bash | 5 +++-- packaging/torchtext/meta.yaml | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 8f1e24f1da..1d0f8af979 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -197,9 +197,10 @@ setup_conda_pytorch_constraint() { # Translate CUDA_VERSION into CUDA_CUDATOOLKIT_CONSTRAINT setup_conda_cudatoolkit_constraint() { - export CONDA_CPUONLY_FEATURE="" + export CONDA_BUILD_VARIANT="cuda" if [[ "$(uname)" == Darwin ]]; then export CONDA_CUDATOOLKIT_CONSTRAINT="" + export CONDA_BUILD_VARIANT="cpu" else case "$CU_VERSION" in cu100) @@ -210,7 +211,7 @@ setup_conda_cudatoolkit_constraint() { ;; cpu) export CONDA_CUDATOOLKIT_CONSTRAINT="" - export CONDA_CPUONLY_FEATURE="- cpuonly" + export CONDA_BUILD_VARIANT="cpu" ;; *) echo "Unrecognized CU_VERSION=$CU_VERSION" diff --git a/packaging/torchtext/meta.yaml b/packaging/torchtext/meta.yaml index 36008e5cf5..dec7eb21e3 100644 --- a/packaging/torchtext/meta.yaml +++ b/packaging/torchtext/meta.yaml @@ -1,3 +1,4 @@ +{% set build_variant = environ.get('CONDA_BUILD_VARIANT', 'cpu') %} package: name: torchtext version: "{{ environ.get('BUILD_VERSION') }}" @@ -14,15 +15,23 @@ requirements: host: - python - setuptools - - cpuonly {{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT') }} run: - python - requests - tqdm + - pytorch-mutex 1.0 {{ build_variant }} # [not osx ] {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} + {% if build_variant == 'cpu' %} + run_constrained: + - cpuonly + {% elif not osx %} + run_constrained: + - cpuonly <0 + {% endif %} + build: string: py{{py}} script_env: @@ -40,7 +49,6 @@ test: requires: - pytest - - cpuonly about: home: https://github.com/pytorch/text