Skip to content

Commit 87c2ac6

Browse files
authored
Merge pull request #1584 from hmoazam/make-dspy-primary
New release flow with dspy-ai as a wrapper depending on dspy and dspy…
2 parents debfd2a + d8b58f5 commit 87c2ac6

File tree

3 files changed

+42
-18
lines changed

3 files changed

+42
-18
lines changed

.github/workflows/build_and_release.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
outputs:
1212
version: ${{ steps.extract_tag.outputs.tag }}
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
- id: extract_tag
1616
name: Extract tag name
1717
run: echo "::set-output name=tag::$(echo $GITHUB_REF | cut -d / -f 3)"
@@ -24,7 +24,7 @@ jobs:
2424
permissions:
2525
id-token: write # IMPORTANT: mandatory for trusted publishing
2626
steps:
27-
- uses: actions/checkout@master
27+
- uses: actions/checkout@v4
2828
- name: Set up Python 3.9
2929
uses: actions/setup-python@v3
3030
with:
@@ -54,7 +54,6 @@ jobs:
5454
uses: pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi/testpypi
5555
with:
5656
repository-url: https://test.pypi.org/legacy/
57-
verbose: true
5857

5958
build-and-publish-pypi:
6059
needs: [extract-tag, build-and-publish-test-pypi]
@@ -64,34 +63,36 @@ jobs:
6463
permissions:
6564
id-token: write # IMPORTANT: mandatory for trusted publishing
6665
steps:
67-
- uses: actions/checkout@master
66+
- uses: actions/checkout@v4
6867
- name: Set up Python 3.9
6968
uses: actions/setup-python@v3
7069
with:
7170
python-version: "3.9"
7271
- name: Install dependencies
7372
run: python3 -m pip install setuptools wheel twine
74-
- name: Update version in setup.py
73+
- name: Update version in setup.py (dspy)
7574
run: sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ needs.extract-tag.outputs.version }}"/;}' setup.py
7675
- name: Update version in pyproject.toml
7776
run: sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ needs.extract-tag.outputs.version }}"/;}' pyproject.toml
78-
# Publish to dspy-ai
79-
- name: Update package name in setup.py
80-
run: sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy-ai"/;}' setup.py
81-
- name: Update package name in pyproject.toml
82-
run: sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy-ai"/;}' pyproject.toml
83-
- name: Build a binary wheel
84-
run: python3 setup.py sdist bdist_wheel
85-
- name: Publish distribution 📦 to PyPI (dspy-ai)
86-
uses: pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi
8777
# Publish to dspy
8878
- name: Update package name in setup.py
89-
run: sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy"/;}' setup.py
79+
run: |
80+
sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy"/;}' setup.py
9081
- name: Update package name in pyproject.toml
9182
run: sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy"/;}' pyproject.toml
9283
- name: Build a binary wheel
9384
run: python3 setup.py sdist bdist_wheel
9485
- name: Publish distribution 📦 to PyPI (dspy)
9586
uses: pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi
96-
97-
87+
# Publish to dspy-ai
88+
- name: Update version in setup.py (dspy-ai)
89+
run: sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ needs.extract-tag.outputs.version }}"/;}' ./dspy/.internal_dspyai/setup.py
90+
- name: Update package name in setup.py
91+
run: sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy-ai"/;}' ./dspy/.internal_dspyai/setup.py
92+
- name: Update dspy dependency version in setup.py
93+
run: |
94+
sed -i '/#replace_dspy_version_marker/{n;s/dspy==[^"]*/dspy==${{ needs.extract-tag.outputs.version }}/;}' ./dspy/.internal_dspyai/setup.py
95+
- name: Build a binary wheel
96+
run: python3 ./dspy/.internal_dspyai/setup.py sdist bdist_wheel
97+
- name: Publish distribution 📦 to PyPI (dspy-ai)
98+
uses: pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi

dspy/.internal_dspyai/setup.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from setuptools import find_packages, setup
2+
3+
# Read the content of the README file
4+
with open("README.md", encoding="utf-8") as f:
5+
long_description = f.read()
6+
7+
setup(
8+
#replace_package_name_marker
9+
name="dspy-ai",
10+
#replace_package_version_marker
11+
version="2.5.3",
12+
description="DSPy",
13+
long_description=long_description,
14+
long_description_content_type="text/markdown",
15+
url="https://github.com/stanfordnlp/dsp",
16+
author="Omar Khattab",
17+
author_email="[email protected]",
18+
license="MIT License",
19+
packages=find_packages(include=["dsp.*", "dspy.*", "dsp", "dspy"]),
20+
python_requires=">=3.9",
21+
#replace_dspy_version_marker
22+
install_requires=["dspy==2.5.3"]
23+
)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
#replace_package_name_marker
13-
name="dspy-ai",
13+
name="dspy",
1414
#replace_package_version_marker
1515
version="2.5.4",
1616
description="DSPy",

0 commit comments

Comments
 (0)