Skip to content

Commit 6ae9ed6

Browse files
authored
Revert "Fix/push versions (#1958)" (#1974)
This reverts commit 1db5272.
1 parent 1db5272 commit 6ae9ed6

File tree

6 files changed

+19
-65
lines changed

6 files changed

+19
-65
lines changed

.github/workflows/build_and_release.yml

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ jobs:
2323
name: pypi
2424
permissions:
2525
id-token: write # IMPORTANT: mandatory for trusted publishing
26-
contents: write
2726
steps:
2827
- uses: actions/checkout@v4
2928
- name: Set up Python 3.9
3029
uses: actions/setup-python@v3
3130
with:
3231
python-version: "3.9"
3332
- name: Install dependencies
34-
run: python3 -m pip install --upgrade setuptools wheel twine semver packaging
33+
run: python3 -m pip install setuptools wheel twine semver packaging
3534
- name: Get correct version for TestPyPI release
3635
id: check_version
3736
run: |
@@ -42,11 +41,11 @@ jobs:
4241
echo "Version to be used for TestPyPI release: $NEW_VERSION"
4342
echo "::set-output name=version::$NEW_VERSION"
4443
- name: Update version in setup.py
45-
run: sed -i '/#replace_package_version_marker/{n;s/__version__="[^"]*"/__version__="${{ steps.check_version.outputs.version }}"/;}' ./dspy/__metadata__.py
44+
run: sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ steps.check_version.outputs.version }}"/;}' setup.py
4645
- name: Update version in pyproject.toml
4746
run: sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ steps.check_version.outputs.version }}"/;}' pyproject.toml
4847
- name: Update package name in setup.py
49-
run: sed -i '/#replace_package_name_marker/{n;s/__name__="[^"]*"/__name__="dspy-ai-test"/;}' ./dspy/__metadata__.py
48+
run: sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy-ai-test"/;}' setup.py
5049
- name: Update package name in pyproject.toml
5150
run: sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy-ai-test"/;}' pyproject.toml
5251
- name: Build a binary wheel
@@ -63,23 +62,22 @@ jobs:
6362
name: pypi
6463
permissions:
6564
id-token: write # IMPORTANT: mandatory for trusted publishing
66-
contents: write
6765
steps:
6866
- uses: actions/checkout@v4
6967
- name: Set up Python 3.9
7068
uses: actions/setup-python@v3
7169
with:
7270
python-version: "3.9"
7371
- name: Install dependencies
74-
run: python3 -m pip install --upgrade setuptools wheel twine
72+
run: python3 -m pip install setuptools wheel twine
7573
- name: Update version in setup.py (dspy)
76-
run: sed -i '/#replace_package_version_marker/{n;s/__version__="[^"]*"/__version__="${{ needs.extract-tag.outputs.version }}"/;}' ./dspy/__metadata__.py
74+
run: sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ needs.extract-tag.outputs.version }}"/;}' setup.py
7775
- name: Update version in pyproject.toml
7876
run: sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ needs.extract-tag.outputs.version }}"/;}' pyproject.toml
7977
# Publish to dspy
8078
- name: Update package name in setup.py
8179
run: |
82-
sed -i '/#replace_package_name_marker/{n;s/__name__="[^"]*"/__name__="dspy"/;}' ./dspy/__metadata__.py
80+
sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy"/;}' setup.py
8381
- name: Update package name in pyproject.toml
8482
run: sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy"/;}' pyproject.toml
8583
- name: Build a binary wheel
@@ -88,7 +86,7 @@ jobs:
8886
uses: pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi
8987
with:
9088
attestations: false
91-
# Publish to dspy-ai
89+
# Publish to dspy-ai
9290
- name: Update version in setup.py (dspy-ai)
9391
run: sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ needs.extract-tag.outputs.version }}"/;}' ./dspy/.internal_dspyai/setup.py
9492
- name: Update package name in setup.py
@@ -101,23 +99,4 @@ jobs:
10199
- name: Publish distribution 📦 to PyPI (dspy-ai)
102100
uses: pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi
103101
with:
104-
attestations: false
105-
- uses: stefanzweifel/git-auto-commit-action@v5 # auto commit changes to main
106-
with:
107-
commit_message: Update versions
108-
create_branch: true
109-
branch: release-${{ needs.extract-tag.outputs.version }}
110-
- name: Checkout main branch
111-
run: |
112-
git fetch origin
113-
git checkout main
114-
- name: Configure git user
115-
run: |
116-
git config --global user.email "[email protected]"
117-
git config --global user.name "Github Actions"
118-
- name: Merge release branch into main
119-
run: |
120-
git merge --no-ff release-${{ needs.extract-tag.outputs.version }}
121-
- name: Push changes to main
122-
run: |
123-
git push origin main
102+
attestations: false

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

dspy/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@
2424
configure = settings.configure
2525
context = settings.context
2626

27-
from .__metadata__ import (
28-
__name__,
29-
__version__,
30-
__description__,
31-
__url__,
32-
__author__,
33-
__author_email__
34-
)
3527

3628
import dspy.teleprompt
3729

dspy/__metadata__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ requires = ["setuptools>=40.8.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
# Do not add spaces around the '=' sign for any of the fields
7-
# preceeded by a marker comment as it affects the publish workflow.
86
#replace_package_name_marker
9-
name="dspy"
7+
name = "dspy"
108
#replace_package_version_marker
11-
version="2.5.43"
9+
version = "2.5.43"
1210
description = "DSPy"
1311
readme = "README.md"
1412
authors = [{ name = "Omar Khattab", email = "[email protected]" }]

setup.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from setuptools import find_packages, setup
2-
import os
32

43
# Read the content of the README file
54
with open("README.md", encoding="utf-8") as f:
@@ -9,25 +8,20 @@
98
with open("requirements.txt", encoding="utf-8") as f:
109
requirements = f.read().splitlines()
1110

12-
metadata = {}
13-
here = os.path.abspath(os.path.dirname(__file__))
14-
with open(os.path.join(here, "dspy", "__metadata__.py"), "r", encoding="utf-8") as f:
15-
exec(f.read(), metadata)
16-
f.close()
17-
18-
1911
setup(
20-
name=metadata["__name__"],
21-
version=metadata["__version__"],
22-
description=metadata["__description__"],
23-
url=metadata["__url__"],
24-
author=metadata["__author__"],
25-
author_email=metadata["__author_email__"],
12+
#replace_package_name_marker
13+
name="dspy",
14+
#replace_package_version_marker
15+
version="2.5.43",
16+
description="DSPy",
2617
long_description=long_description,
2718
long_description_content_type="text/markdown",
19+
url="https://github.com/stanfordnlp/dspy",
20+
author="Omar Khattab",
21+
author_email="[email protected]",
2822
license="MIT License",
2923
packages=find_packages(include=["dspy.*", "dspy"]),
30-
python_requires=">=3.9",
24+
python_requires=">=3.9",
3125
install_requires=requirements,
3226

3327
extras_require={

0 commit comments

Comments
 (0)