diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index b00b1f1b..fd377770 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -10,7 +10,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - run: python setup.py bdist_wheel + - run: python setup.py bdist_wheel --python-tag=py3 - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/setup.py b/setup.py index d03fd91f..21b2f713 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ import os import re import time +import sys from setuptools import find_packages from setuptools import setup @@ -33,6 +34,10 @@ with open(os.path.join(here, 'brainpy', '__init__.py'), 'r') as f: init_py = f.read() version = re.search('__version__ = "(.*)"', init_py).groups()[0] +if len(sys.argv) > 2 and sys.argv[2] == '--python-tag=py3': + version = version +else: + version += '.post{}'.format(time.strftime("%Y%m%d", time.localtime())) # obtain long description from README with io.open(os.path.join(here, 'README.md'), 'r', encoding='utf-8') as f: @@ -44,7 +49,7 @@ # setup setup( name='brainpy', - version=version + '.post{}'.format(time.strftime("%Y%m%d", time.localtime())), + version=version, description='BrainPy: Brain Dynamics Programming in Python', long_description=README, long_description_content_type="text/markdown",