File tree 3 files changed +22
-14
lines changed 3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,14 @@ jobs:
18
18
run : |
19
19
python -m pip install --upgrade pip
20
20
pip install setuptools wheel twine
21
- - name : Get current date
22
- id : date
23
- run : echo "::set-output name=date::$(date +'%Y%m%d')"
24
21
- name : Build package
25
22
run : |
26
- version=$(python setup.py --version)
27
- new_version="${version}.dev${{ steps.date.outputs.date }}"
28
- sed -i "s/version=.*/version='${new_version}',/" setup.py
23
+ export TORCHAO_NIGHTLY=1
29
24
python setup.py sdist bdist_wheel
30
25
- name : Publish package to PyPI
31
26
uses : pypa/gh-action-pypi-publish@release/v1
32
27
with :
33
28
user : __token__
34
29
password : ${{ secrets.PYPI_API_TOKEN }}
35
- repository_url : https://pypi.org/project/torchao-nightly /
30
+ repository_url : https://upload. pypi.org/legacy /
36
31
packages_dir : dist/
Original file line number Diff line number Diff line change
1
+ torch
1
2
numpy
2
- sentencepiece
3
+ sentencepiece
Original file line number Diff line number Diff line change 1
1
# Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
# All rights reserved.
3
-
4
3
# This source code is licensed under the license found in the
5
4
# LICENSE file in the root directory of this source tree.
6
5
6
+ import os
7
+ from datetime import datetime
7
8
from setuptools import setup , find_packages
9
+ current_date = datetime .now ().strftime ('%Y.%m.%d' )
10
+
11
+
12
+ def read_requirements (file_path ):
13
+ with open (file_path , 'r' ) as file :
14
+ return file .read ().splitlines ()
15
+
16
+ # Determine the package name based on the presence of an environment variable
17
+ package_name = 'torchao-nightly' if os .environ .get ('TORCHAO_NIGHTLY' ) else 'torchao'
18
+
19
+ # Version is year.month.date if using nightlies
20
+ version = current_date if package_name == 'torchao-nightly' else '0.0.3'
21
+
8
22
9
23
setup (
10
- name = 'torchao' ,
11
- version = '0.0.3' ,
24
+ name = package_name ,
25
+ version = version ,
12
26
packages = find_packages (),
13
- install_requires = [
14
- 'torch' ,
15
- ],
27
+ install_requires = read_requirements ('requirements.txt' ),
16
28
description = 'Package for applying ao techniques to GPU models' ,
17
29
long_description = open ('README.md' ).read (),
18
30
long_description_content_type = 'text/markdown' ,
You can’t perform that action at this time.
0 commit comments