From 6265f33428cfd99ac8b69b09a1628112291b45dc Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Tue, 21 Dec 2021 05:23:18 -0600 Subject: [PATCH 1/7] Adding `torchcam` from PyPI --- recipes/torchcam/meta.yaml | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 recipes/torchcam/meta.yaml diff --git a/recipes/torchcam/meta.yaml b/recipes/torchcam/meta.yaml new file mode 100644 index 0000000000000..ebdb158aaee4d --- /dev/null +++ b/recipes/torchcam/meta.yaml @@ -0,0 +1,57 @@ +{% set name = "torchcam" %} +{% set version = "0.3.1" %} + + +package: + name: {{ name|lower }} + version: {{ version }} + +source: + url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/torchcam-{{ version }}.tar.gz + sha256: 400d451cbbafe0dbddbf3a22feab9e23d1317e90cf6eae16bca96e0e2ff4f076 + +build: + number: 0 + noarch: python + script: + {% set reqfile = "requirements.txt" %} + {% set reqsource = name ~ ".egg-info/requires.txt" %} + # IF {{ reqfile }} is NOT PRESENT, COPY {{ reqfile }} from {{ reqsource }} + - if [ ! -f {{ reqfile }} ] && [ -f {{ reqsource }} ]; then cp {{ reqsource }} {{ reqfile }}; fi # [not win] + - copy {{ name }}.egg-info\requires.txt {{ reqfile }} # [win] + - {{ PYTHON }} -m pip install . -vv + +requirements: + host: + - pip + - python >=3.6 + run: + - python >=3.6 + - matplotlib-base >=3.0.0 + - numpy >=1.14.0 + - pillow >=8.3.2 + - torch >=1.5.1 + +test: + imports: + - torchcam + - torchcam.methods + commands: + - pip check + requires: + - pip + +about: + home: https://github.com/frgfm/torch-cam + summary: Class activation maps for your PyTorch CNN models + license: Apache-2.0 + license_file: LICENSE + description: | + Simple way to leverage the class-specific activation of + convolutional layers in PyTorch. + doc_url: https://frgfm.github.io/torch-cam + dev_url: https://github.com/frgfm/torch-cam + +extra: + recipe-maintainers: + - sugatoray From e676df49a97978cb17e4cf609cd65b8dde4ab100 Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Tue, 21 Dec 2021 05:28:28 -0600 Subject: [PATCH 2/7] reworded torch as pytorch --- recipes/torchcam/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/torchcam/meta.yaml b/recipes/torchcam/meta.yaml index ebdb158aaee4d..3bf299021a461 100644 --- a/recipes/torchcam/meta.yaml +++ b/recipes/torchcam/meta.yaml @@ -30,7 +30,7 @@ requirements: - matplotlib-base >=3.0.0 - numpy >=1.14.0 - pillow >=8.3.2 - - torch >=1.5.1 + - pytorch >=1.5.1 test: imports: From f6e07e82af068d704a1b475402725b205ae260b2 Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Tue, 21 Dec 2021 05:58:08 -0600 Subject: [PATCH 3/7] updated script section - inclusion of reqfile - exclision of tests folder - comments - echo out rendered recipe --- recipes/torchcam/meta.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/recipes/torchcam/meta.yaml b/recipes/torchcam/meta.yaml index 3bf299021a461..39df4a4d83117 100644 --- a/recipes/torchcam/meta.yaml +++ b/recipes/torchcam/meta.yaml @@ -14,11 +14,23 @@ build: number: 0 noarch: python script: + ## Show the rendered recipe + - echo -e "\n>>> Show recipe '{{ name }}/meta.yaml' <<<\n\n" + - echo -e $(cat $RECIPE_DIR/meta.yaml) # [not win] + ## Ensure inclusion of requirements.txt {% set reqfile = "requirements.txt" %} {% set reqsource = name ~ ".egg-info/requires.txt" %} # IF {{ reqfile }} is NOT PRESENT, COPY {{ reqfile }} from {{ reqsource }} + - echo -e "\n>>> ENSURE INCLUSION OF '{{ reqfile }}' <<<\n\n" - if [ ! -f {{ reqfile }} ] && [ -f {{ reqsource }} ]; then cp {{ reqsource }} {{ reqfile }}; fi # [not win] - - copy {{ name }}.egg-info\requires.txt {{ reqfile }} # [win] + #- copy {{ name }}.egg-info\requires.txt {{ reqfile }} # [win] + - copy {{ reqsource | replace('/', '\\') }} {{ reqfile }} # [win] + ## Ensure exclusion of tests folder + {% set testsfolder = "test" %} + - echo -e "\n>>> ENSURE EXCLUSION OF '{{ testsfolder }}' <<<\n\n" + - rm -rf {{ testsfolder }} # [not win] + - rmdir /s /q "{{ testsfolder | replace('/', '\\') }}" # [win] + ## Install package {{ name }} from PyPI - {{ PYTHON }} -m pip install . -vv requirements: From 64e3539d80455144f7b463298ac1fa68b9d024b9 Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Tue, 21 Dec 2021 11:09:29 -0600 Subject: [PATCH 4/7] removed two test lines from the script --- recipes/torchcam/meta.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/torchcam/meta.yaml b/recipes/torchcam/meta.yaml index 39df4a4d83117..e18308ee6369b 100644 --- a/recipes/torchcam/meta.yaml +++ b/recipes/torchcam/meta.yaml @@ -14,9 +14,6 @@ build: number: 0 noarch: python script: - ## Show the rendered recipe - - echo -e "\n>>> Show recipe '{{ name }}/meta.yaml' <<<\n\n" - - echo -e $(cat $RECIPE_DIR/meta.yaml) # [not win] ## Ensure inclusion of requirements.txt {% set reqfile = "requirements.txt" %} {% set reqsource = name ~ ".egg-info/requires.txt" %} From df31ca0995514dc934caf3d651d2731519b97bab Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Tue, 21 Dec 2021 11:10:19 -0600 Subject: [PATCH 5/7] minor changes --- recipes/torchcam/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/torchcam/meta.yaml b/recipes/torchcam/meta.yaml index e18308ee6369b..5bf7a6e379db2 100644 --- a/recipes/torchcam/meta.yaml +++ b/recipes/torchcam/meta.yaml @@ -18,13 +18,13 @@ build: {% set reqfile = "requirements.txt" %} {% set reqsource = name ~ ".egg-info/requires.txt" %} # IF {{ reqfile }} is NOT PRESENT, COPY {{ reqfile }} from {{ reqsource }} - - echo -e "\n>>> ENSURE INCLUSION OF '{{ reqfile }}' <<<\n\n" + - echo -e "\n>>> ENSURE INCLUSION OF FILE '{{ reqfile }}' <<<\n\n" - if [ ! -f {{ reqfile }} ] && [ -f {{ reqsource }} ]; then cp {{ reqsource }} {{ reqfile }}; fi # [not win] #- copy {{ name }}.egg-info\requires.txt {{ reqfile }} # [win] - copy {{ reqsource | replace('/', '\\') }} {{ reqfile }} # [win] ## Ensure exclusion of tests folder {% set testsfolder = "test" %} - - echo -e "\n>>> ENSURE EXCLUSION OF '{{ testsfolder }}' <<<\n\n" + - echo -e "\n>>> ENSURE EXCLUSION OF FOLDER '{{ testsfolder }}' <<<\n\n" - rm -rf {{ testsfolder }} # [not win] - rmdir /s /q "{{ testsfolder | replace('/', '\\') }}" # [win] ## Install package {{ name }} from PyPI From ee97be781ee004268060815ed3c45dd3baea805f Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Thu, 23 Dec 2021 10:39:30 -0600 Subject: [PATCH 6/7] updated recipe - removed redundant scripts --- recipes/torchcam/meta.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/recipes/torchcam/meta.yaml b/recipes/torchcam/meta.yaml index 5bf7a6e379db2..f4543f5645024 100644 --- a/recipes/torchcam/meta.yaml +++ b/recipes/torchcam/meta.yaml @@ -13,15 +13,7 @@ source: build: number: 0 noarch: python - script: - ## Ensure inclusion of requirements.txt - {% set reqfile = "requirements.txt" %} - {% set reqsource = name ~ ".egg-info/requires.txt" %} - # IF {{ reqfile }} is NOT PRESENT, COPY {{ reqfile }} from {{ reqsource }} - - echo -e "\n>>> ENSURE INCLUSION OF FILE '{{ reqfile }}' <<<\n\n" - - if [ ! -f {{ reqfile }} ] && [ -f {{ reqsource }} ]; then cp {{ reqsource }} {{ reqfile }}; fi # [not win] - #- copy {{ name }}.egg-info\requires.txt {{ reqfile }} # [win] - - copy {{ reqsource | replace('/', '\\') }} {{ reqfile }} # [win] + script: ## Ensure exclusion of tests folder {% set testsfolder = "test" %} - echo -e "\n>>> ENSURE EXCLUSION OF FOLDER '{{ testsfolder }}' <<<\n\n" From a8cb6d12dbfe2950498ac8f4d676531599538d1c Mon Sep 17 00:00:00 2001 From: Sugato Ray Date: Thu, 23 Dec 2021 11:52:27 -0600 Subject: [PATCH 7/7] updated recipe: include review-suggestions --- recipes/torchcam/meta.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/recipes/torchcam/meta.yaml b/recipes/torchcam/meta.yaml index f4543f5645024..899c629cda3f9 100644 --- a/recipes/torchcam/meta.yaml +++ b/recipes/torchcam/meta.yaml @@ -15,10 +15,7 @@ build: noarch: python script: ## Ensure exclusion of tests folder - {% set testsfolder = "test" %} - - echo -e "\n>>> ENSURE EXCLUSION OF FOLDER '{{ testsfolder }}' <<<\n\n" - - rm -rf {{ testsfolder }} # [not win] - - rmdir /s /q "{{ testsfolder | replace('/', '\\') }}" # [win] + - rm -rf test # [not win] ## Install package {{ name }} from PyPI - {{ PYTHON }} -m pip install . -vv