Skip to content

Commit

Permalink
enhance: switch to poetry
Browse files Browse the repository at this point in the history
Signed-off-by: yangxuan <[email protected]>
  • Loading branch information
XuanYang-cn committed Dec 13, 2023
1 parent f12777b commit 0d8878c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 28 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/publish_dev_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,15 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install pypa/build
- name: Install poetry
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
make package
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/publish_on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,15 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install pypa/build
- name: Install poetry
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
make package
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following collection shows Milvus versions and recommended PyMilvus versions
| 2.0.\* | 2.0.2 |
| 2.1.\* | 2.1.3 |
| 2.2.\* | 2.2.15 |
| 2.3.\* | 2.3.0 |
| 2.3.\* | 2.3.4 |


## Installation
Expand Down Expand Up @@ -97,18 +97,18 @@ Documentation is available online: https://milvus.io/api-reference/pymilvus/v2.3

The commits on the development branch of each version will be packaged and uploaded to [Test PyPI](https://test.pypi.org/).

The package name generated by the development branch is x.y.z.dev<dist>, where <dist> is the number of commits that differ from the most recent release.
The package name generated by the development branch is x.y.z.rc<dist>, where <dist> is the number of commits that differ from the most recent release.

- For example, after the release of 2.0.1, two commits were submitted on the 2.0 branch.
The version number of the latest commit of 2.0 branch is **2.0.2.dev2**.
For example, after the release of **2.3.4**,

- For example, after the release of 2.0.1, 10 commits were submitted on the master branch.
The version number of the latest commit of master branch is **2.1.0.dev10**.
- the next dev release from branch 2.3 would be **2.3.5.rc1**,

- the next dev release from branch master would be **2.4.0.rc1**.


To install the package on Test PyPi, you need to append `--extra-index-url` after pip, for example:
```shell
$ python3 -m pip install --extra-index-url https://test.pypi.org/simple/ pymilvus==2.1.0.dev66
$ python3 -m pip install --extra-index-url https://test.pypi.org/simple/ pymilvus==2.3.5.rc1
```


Expand Down
30 changes: 23 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
[build-system]
requires = [
"setuptools >= 67",
"wheel",
"gitpython",
"setuptools_scm[toml]>=6.2",
]
build-backend = "setuptools.build_meta"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry]
name = "pymilvus"
description = "Python Sdk for Milvus"
authors = ["Milvus Team <[email protected]>"]
readme = "README.md"
packages = [{include = "pymilvus"}]
version = "0.0.0"

[tool.poetry-dynamic-versioning]
enable = true
format-jinja = """
{%- if distance == 0 -%}
{{ serialize_pep440(base, stage, revision) }}
{%- elif base is not None and not base.startswith(branch) -%}
{{ serialize_pep440(bump_version(base, 1), "rc", distance) }}
{%- else -%}
{{ serialize_pep440(bump_version(base), "rc", distance) }}
{%- endif -%}
"""

[project]
name="pymilvus"
Expand Down Expand Up @@ -166,3 +181,4 @@ builtins-ignorelist = [
"dict", # TODO
"filter",
]

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ ruff
black
requests
minio
poetry
poetry-dynamic-versioning>=1.0.0,<2.0.0

0 comments on commit 0d8878c

Please sign in to comment.