From 3c3796c039161ea0fa00494264bd0f875f3c8d13 Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Mon, 18 Dec 2023 15:40:53 +0200 Subject: [PATCH 1/4] feat: release candidate --- ai21/version.py | 2 +- pyproject.toml | 11 ++++++----- setup.py | 18 +++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ai21/version.py b/ai21/version.py index 21014090..0a3192fe 100644 --- a/ai21/version.py +++ b/ai21/version.py @@ -1 +1 @@ -VERSION = "2.0.0" +VERSION = "1.9.0" diff --git a/pyproject.toml b/pyproject.toml index 8002b575..79aaec98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ exclude_lines = [ [tool.poetry] name = "ai21" -version = "2.0.0" +version = "1.9.0" description = "" authors = ["AI21 Labs"] readme = "README.md" @@ -100,15 +100,16 @@ version_toml = [ version_variables = [ "ai21/version.py:VERSION" ] -match = "(main)" +match = "(pre_release_publish)" build_command = "pip install poetry && poetry build" version_source = "tag" commit_version_number = true -major_on_zero = true commit_message = "chore(release): v{version} [skip ci]" -[tool.semantic_release.branches.main] -match = "(main)" +[tool.semantic_release.branches.pre_release_publish] +match = "(pre_release_publish)" +prerelease_token = "rc" +prerelease = true [tool.semantic_release.changelog.environment] newline_sequence = "\n" diff --git a/setup.py b/setup.py index 4c1f237c..5b7dc1b6 100755 --- a/setup.py +++ b/setup.py @@ -3,24 +3,24 @@ import os from setuptools import setup, find_packages +from ai21.version import VERSION -current_folder = os.path.abspath(os.path.dirname(__file__)) -version_file_path = current_folder + "/ai21/version.py" -version_file = {} -with open(version_file_path, "rt") as f: - exec(f.read(), version_file) -version = version_file["__version__"] +with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh: + long_description = "\\n" + fh.read() + setup( name="ai21", - version=version, + version=VERSION, license="MIT", - author="ai21 labs", + author="AI21 Labs", author_email="support@ai21.com", + long_description_content_type="text/markdown", + long_description=long_description, packages=find_packages(exclude=["tests", "tests.*"]), + keywords=["python", "sdk", "ai", "ai21", "jurassic", "ai21-python", "llm"], install_requires=[ "requests", ], - # extras_require={"AWS": ["boto3>=1.28.82"]}, ) From 8940537f17635594866d7c6ec6a3320a780de5ed Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Mon, 18 Dec 2023 15:42:00 +0200 Subject: [PATCH 2/4] fix: branch name --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 79aaec98..714af3d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,14 +100,14 @@ version_toml = [ version_variables = [ "ai21/version.py:VERSION" ] -match = "(pre_release_publish)" +match = "(main)" build_command = "pip install poetry && poetry build" version_source = "tag" commit_version_number = true commit_message = "chore(release): v{version} [skip ci]" -[tool.semantic_release.branches.pre_release_publish] -match = "(pre_release_publish)" +[tool.semantic_release.branches.main] +match = "(main)" prerelease_token = "rc" prerelease = true From 3476a4b171ab00e5ba7620a317d260dc549b8c4b Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Mon, 18 Dec 2023 15:47:47 +0200 Subject: [PATCH 3/4] fix: imports --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5b7dc1b6..8db436ba 100755 --- a/setup.py +++ b/setup.py @@ -1,15 +1,16 @@ #!/usr/bin/python3 import os +import codecs from setuptools import setup, find_packages from ai21.version import VERSION +readme_path = os.path.abspath(os.path.dirname(__file__)) -with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh: +with codecs.open(os.path.join(readme_path, "README.md"), encoding="utf-8") as fh: long_description = "\\n" + fh.read() - setup( name="ai21", version=VERSION, From 1a0c5c7e3d08ac34effaac5b604b61256b479d6f Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Mon, 18 Dec 2023 16:01:09 +0200 Subject: [PATCH 4/4] fix: push to test pypi --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e27ee41b..51a751c0 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -37,4 +37,4 @@ jobs: uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + password: ${{ secrets.TEST_PYPI_TOKEN }}