diff --git a/README.md b/README.md index 2fd97d8..5ffc545 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -About -feedstock +About thop-feedstock ======================= Feedstock license: [BSD-3-Clause](LICENSE) -Home: +Home: https://github.com/Lyken17/pytorch-OpCounter -Package license: +Package license: MIT -Summary: +Summary: Count the MACs / FLOPs of your PyTorch model. Current release info @@ -15,19 +15,19 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | -| [![Conda Recipe](https://img.shields.io/badge/recipe--green.svg)](https://anaconda.org/anaconda/) | [![Conda Downloads](https://img.shields.io/conda/dn/anaconda/.svg)](https://anaconda.org/anaconda/) | [![Conda Version](https://img.shields.io/conda/vn/anaconda/.svg)](https://anaconda.org/anaconda/) | [![Conda Platforms](https://img.shields.io/conda/pn/anaconda/.svg)](https://anaconda.org/anaconda/) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-thop-green.svg)](https://anaconda.org/anaconda/thop) | [![Conda Downloads](https://img.shields.io/conda/dn/anaconda/thop.svg)](https://anaconda.org/anaconda/thop) | [![Conda Version](https://img.shields.io/conda/vn/anaconda/thop.svg)](https://anaconda.org/anaconda/thop) | [![Conda Platforms](https://img.shields.io/conda/pn/anaconda/thop.svg)](https://anaconda.org/anaconda/thop) | -Installing +Installing thop ================== -Installing `` from the main channel can be achieved by: +Installing `thop` from the main channel can be achieved by: ``` -conda install +conda install thop ``` -It is possible to list all of the versions of `` available on your platform with `conda`: +It is possible to list all of the versions of `thop` available on your platform with `conda`: ``` -conda search +conda search thop ``` \ No newline at end of file diff --git a/abs.yaml b/abs.yaml new file mode 100644 index 0000000..1ed0d29 --- /dev/null +++ b/abs.yaml @@ -0,0 +1,2 @@ +upload_channels: + - sfe1ed40 diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 2bddf19..0000000 --- a/pull_request_template.md +++ /dev/null @@ -1,15 +0,0 @@ -{package} {version} {:snowflake:} - -**Destination channel:** {Snowflake | defaults} - -### Links - -- [{ticket_number}]() -- [Upstream repository]() -- [Upstream changelog/diff]() -- Relevant dependency PRs: - - ... - -### Explanation of changes: - -- ... diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 9018614..60c13d7 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,45 +1,61 @@ -{% set name = "" %} -{% set version = "" %} +{% set name = "thop" %} +{% set version = "0.1.1.post2209072238" %} +{% set commit_id = "43c064afb71383501e41eaef9e8c8407265cf77f" %} package: name: {{ name|lower }} version: {{ version }} source: - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz - sha256: + # use github archive release for tests, LICENSE, and because there is no sdist on PyPi + url: https://github.com/Lyken17/pytorch-OpCounter/archive/{{ commit_id }}.tar.gz + sha256: cbda9dc83ad9b78a9fbc8d89f8f1fb1da8ca284b39faab3e9ed697fb2bee909f + patches: + - patches/0001-use-conda-build-version-for-pkg.patch build: number: 0 - script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation skip: True # [py<38] + script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation requirements: + build: + - patch # [not win] + - m2-patch # [win] host: - python - pip + - setuptools + - wheel run: - python + - pytorch test: imports: - - {{ name.replace('-', '.') }} + - thop requires: - pip + - pytest + source_files: + - tests commands: - pip check + # check that pip gets the correct version + - python -c "from importlib.metadata import version; assert(version('{{ name }}')=='{{ version }}')" + - pytest tests about: - home: - summary: + home: https://github.com/Lyken17/pytorch-OpCounter + summary: Count the MACs / FLOPs of your PyTorch model. description: | - - license: - license_family: - license_file: - dev_url: - doc_url: + Count the MACs / FLOPs of your PyTorch model. + license: MIT + license_family: MIT + license_file: LICENSE + dev_url: https://github.com/Lyken17/pytorch-OpCounter + doc_url: https://github.com/Lyken17/pytorch-OpCounter extra: recipe-maintainers: - - Jrice1317 + - lorepirri diff --git a/recipe/patches/0001-use-conda-build-version-for-pkg.patch b/recipe/patches/0001-use-conda-build-version-for-pkg.patch new file mode 100644 index 0000000..025abd2 --- /dev/null +++ b/recipe/patches/0001-use-conda-build-version-for-pkg.patch @@ -0,0 +1,43 @@ +From bd8bdee45c2584f3633e2534979657f659546e9f Mon Sep 17 00:00:00 2001 +From: Lorenzo Pirritano +Date: Mon, 4 Nov 2024 14:22:12 +0100 +Subject: [PATCH] use conda build version for pkg + +The version is generated with the timestamp as suffix each time +setup.py is run (every time we build the package). + +With this patch we override the package version to the conda build +one (from the environment variable PKG_VERSION). + +--- + setup.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/setup.py b/setup.py +index 100bd16..d14cace 100644 +--- a/setup.py ++++ b/setup.py +@@ -8,8 +8,8 @@ from setuptools.command.install import install + + readme = open("README.md").read() + +-fp = open("thop/__version__.py", "r").read() +-VERSION = eval(fp.strip().split()[-1]) ++# fp = open("thop/__version__.py", "r").read() ++# VERSION = eval(fp.strip().split()[-1]) + + requirements = [ + "torch", +@@ -18,7 +18,8 @@ requirements = [ + # import subprocess + # commit_hash = subprocess.check_output("git rev-parse HEAD", shell=True).decode('UTF-8').rstrip() + # VERSION += "_" + str(int(commit_hash, 16))[:8] +-VERSION += "_" + datetime.datetime.now().strftime("%Y%m%d%H%M")[2:] ++# VERSION += "_" + datetime.datetime.now().strftime("%Y%m%d%H%M")[2:] ++VERSION = os.environ['PKG_VERSION'] + print(VERSION) + + setup( +-- +2.39.1 +