Skip to content

Commit

Permalink
Version control in Publish.yml CI (#610)
Browse files Browse the repository at this point in the history
version control in Publish.yml CI
  • Loading branch information
chaoming0625 authored Feb 1, 2024
1 parent a9996f3 commit 6b6a62f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import re
import time
import sys

from setuptools import find_packages
from setuptools import setup
Expand Down Expand Up @@ -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:
Expand All @@ -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",
Expand Down

0 comments on commit 6b6a62f

Please sign in to comment.