-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from AnacondaRecipes/PKG-5880-thop-0_1_1_post-2…
…209072238 thop 0.1.1.post2209072238 ❄️
- Loading branch information
Showing
5 changed files
with
86 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
About <pkg_name>-feedstock | ||
About thop-feedstock | ||
======================= | ||
|
||
Feedstock license: [BSD-3-Clause](LICENSE) | ||
|
||
Home: <home_url> | ||
Home: https://github.com/Lyken17/pytorch-OpCounter | ||
|
||
Package license: <pkg_license> | ||
Package license: MIT | ||
|
||
Summary: <pkg_summary> | ||
Summary: Count the MACs / FLOPs of your PyTorch model. | ||
|
||
|
||
Current release info | ||
==================== | ||
|
||
| Name | Downloads | Version | Platforms | | ||
| --- | --- | --- | --- | | ||
| [![Conda Recipe](https://img.shields.io/badge/recipe-<pkg_name>-green.svg)](https://anaconda.org/anaconda/<pkg_name>) | [![Conda Downloads](https://img.shields.io/conda/dn/anaconda/<pkg_name>.svg)](https://anaconda.org/anaconda/<pkg_name>) | [![Conda Version](https://img.shields.io/conda/vn/anaconda/<pkg_name>.svg)](https://anaconda.org/anaconda/<pkg_name>) | [![Conda Platforms](https://img.shields.io/conda/pn/anaconda/<pkg_name>.svg)](https://anaconda.org/anaconda/<pkg_name>) | | ||
| [![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 <pkg_name> | ||
Installing thop | ||
================== | ||
|
||
Installing `<pkg_name>` from the main channel can be achieved by: | ||
Installing `thop` from the main channel can be achieved by: | ||
|
||
``` | ||
conda install <pkg_name> | ||
conda install thop | ||
``` | ||
|
||
It is possible to list all of the versions of `<pkg_name>` 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 <pkg_name> | ||
conda search thop | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
upload_channels: | ||
- sfe1ed40 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,61 @@ | ||
{% set name = "<PLEASE ADD PKG NAME>" %} | ||
{% set version = "<PLEASE ADD PKG 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: <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: <PLEASE ADD HOME URL> | ||
summary: <PLEASE ADD SUMMARY> | ||
home: https://github.com/Lyken17/pytorch-OpCounter | ||
summary: Count the MACs / FLOPs of your PyTorch model. | ||
description: | | ||
<PLEASE ADD DESCRIPTION> | ||
license: <PLEASE ADD LICENSE> | ||
license_family: <PLEASE ADD LICENSE_FAMILY> | ||
license_file: <PLEASE_ADD_LICENSE_FILE> | ||
dev_url: <PLEASE ADD DEV URL> | ||
doc_url: <PLEASE ADD 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From bd8bdee45c2584f3633e2534979657f659546e9f Mon Sep 17 00:00:00 2001 | ||
From: Lorenzo Pirritano <[email protected]> | ||
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 | ||
|