Skip to content

Commit

Permalink
fix pub version (#1047)
Browse files Browse the repository at this point in the history
VERSION_LOCAL_SCHEME=no-local-version python -m build

Successfully built onediff-1.1.1.dev66.tar.gz and
onediff-1.1.1.dev66-py3-none-any.whl
  • Loading branch information
strint authored Jul 27, 2024
1 parent f50c02b commit a6b8b05
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/pub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get current date
id: date
run: |
sed -i '1d' "src/onediff/__init__.py"
sed -i '1d' "onediff_diffusers_extensions/onediffx/__init__.py"
formatted_date=$(date +'%Y%m%d%H%M')
echo "__version__ = \"1.2.0.dev${formatted_date}\"" >> src/onediff/__init__.py
echo "__version__ = \"1.2.0.dev${formatted_date}\"" >> onediff_diffusers_extensions/onediffx/__init__.py
- run: cat src/onediff/__init__.py
- run: python3 -m pip install build
- name: Set environment variable
env:
VERSION_LOCAL_SCHEME: no-local-version
run: echo "VERSION_LOCAL_SCHEME=$VERSION_LOCAL_SCHEME"
- run: python3 -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
Expand Down
5 changes: 5 additions & 0 deletions onediff_diffusers_extensions/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os

from setuptools import find_packages, setup


local_scheme = os.getenv("VERSION_LOCAL_SCHEME", "node-and-date")
setup(
name="onediffx",
description="onediff extensions for diffusers",
Expand Down Expand Up @@ -37,6 +40,8 @@
"root": "../",
"write_to": "./onediff_diffusers_extensions/onediffx/_version.py",
"fallback_version": "0.0.0",
"version_scheme": "guess-next-dev",
"local_scheme": local_scheme,
},
setup_requires=["setuptools_scm"],
)
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import os

from setuptools import find_packages, setup

local_scheme = os.getenv("VERSION_LOCAL_SCHEME", "node-and-date")

setup(
name="onediff",
Expand Down Expand Up @@ -43,6 +46,8 @@
use_scm_version={
"write_to": "src/onediff/_version.py",
"fallback_version": "0.0.0",
"version_scheme": "guess-next-dev",
"local_scheme": local_scheme,
},
setup_requires=["setuptools_scm"],
)

0 comments on commit a6b8b05

Please sign in to comment.