From fb5bb87dcadbc571440fe89a5ec96fbd29730931 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 14:37:27 +0530 Subject: [PATCH 01/18] add bump2version --- .bumpversion.cfg | 9 +++++++++ .pre-commit-config.yaml | 1 + justfile | 21 +++++++++++++++++++++ pyproject.toml | 10 +++++++++- syftbox/__init__.py | 1 - syftbox/__version__.py | 11 +++++++++++ uv.lock | 13 ++++++++++++- 7 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 .bumpversion.cfg create mode 100644 syftbox/__version__.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 00000000..7a02aa92 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,9 @@ +[bumpversion] +current_version = 0.1.0 +parse = (?P\d+)\.(?P\d+)\.(?P\d+) +serialize = + {major}.{minor}.{patch} + +[bumpversion:file:pyproject.toml] + +[bumpversion:file:syftbox/__version__.py] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d29e38f..66996fb5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,7 @@ repos: always_run: true - id: trailing-whitespace always_run: true + exclude: .bumpversion.cfg - id: check-docstring-first always_run: true - id: check-json diff --git a/justfile b/justfile index 6ee621ff..cacc1ac2 100644 --- a/justfile +++ b/justfile @@ -107,6 +107,27 @@ deploy keyfile remote="azureuser@20.168.10.234": build echo -e "{{ _green }}Deploy successful!{{ _nc }}" +[group('build')] +bumpver level="patch": + #!/bin/bash + set -eou pipefail + + # get the current and new version + CURRENT_VERSION=$(uv run --extra dev bump2version --dry-run --list {{ level }} | grep current_version | cut -d'=' -f2) + NEW_VERSION=$(uv run --extra dev bump2version --dry-run --list {{ level }} | grep new_version | cut -d'=' -f2) + + echo "Bumping version from $CURRENT_VERSION to $NEW_VERSION" + + # first bump version + uv run --extra dev bump2version {{ level }} + + # get an updated lock file + uv lock + + # commit the changes + git commit -am "Bump version $CURRENT_VERSION -> $NEW_VERSION" + git tag -a $NEW_VERSION -m "Release $NEW_VERSION" + # --------------------------------------------------------------------------------------------------------------------- [group('utils')] diff --git a/pyproject.toml b/pyproject.toml index 89499cd3..fe85da9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,15 @@ syftbox = "syftbox.main:main" pythonpath = ["."] [project.optional-dependencies] -dev = ["pytest", "pytest-xdist[psutil]", "pytest-cov", "mypy", "uv", "ruff"] +dev = [ + "pytest", + "pytest-xdist[psutil]", + "pytest-cov", + "mypy", + "uv", + "ruff", + "bump2version", +] [tool.ruff] diff --git a/syftbox/__init__.py b/syftbox/__init__.py index 3dc1f76b..e69de29b 100644 --- a/syftbox/__init__.py +++ b/syftbox/__init__.py @@ -1 +0,0 @@ -__version__ = "0.1.0" diff --git a/syftbox/__version__.py b/syftbox/__version__.py new file mode 100644 index 00000000..222439bb --- /dev/null +++ b/syftbox/__version__.py @@ -0,0 +1,11 @@ +# ____ __ _ ____ +# / ___| _ _ / _| |_| __ ) _____ __ +# \___ \| | | | |_| __| _ \ / _ \ \/ / +# ___) | |_| | _| |_| |_) | (_) > < +# |____/ \__, |_| \__|____/ \___/_/\_\ +# |___/ + +__title__ = "SyftBox" +__description__ = "" +__url__ = "https://openmined.org" +__version__ = "0.1.0" diff --git a/uv.lock b/uv.lock index 2ded3862..1f642e21 100644 --- a/uv.lock +++ b/uv.lock @@ -45,6 +45,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/13/b5/7af0cb920a476dccd612fbc9a21a3745fb29b1fcd74636078db8f7ba294c/APScheduler-3.10.4-py3-none-any.whl", hash = "sha256:fb91e8a768632a4756a585f79ec834e0e27aad5860bac7eaa523d9ccefd87661", size = 59303 }, ] +[[package]] +name = "bump2version" +version = "1.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/29/2a/688aca6eeebfe8941235be53f4da780c6edee05dbbea5d7abaa3aab6fad2/bump2version-1.0.1.tar.gz", hash = "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6", size = 36236 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1d/e3/fa60c47d7c344533142eb3af0b73234ef8ea3fb2da742ab976b947e717df/bump2version-1.0.1-py2.py3-none-any.whl", hash = "sha256:37f927ea17cde7ae2d7baf832f8e80ce3777624554a653006c9144f8017fe410", size = 22030 }, +] + [[package]] name = "certifi" version = "2024.8.30" @@ -433,7 +442,7 @@ name = "importlib-metadata" version = "8.5.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "zipp" }, + { name = "zipp", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/cd/12/33e59336dca5be0c398a7482335911a33aa0e20776128f038019f1a95f1b/importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7", size = 55304 } wheels = [ @@ -1100,6 +1109,7 @@ dependencies = [ [package.optional-dependencies] dev = [ + { name = "bump2version" }, { name = "mypy" }, { name = "pytest" }, { name = "pytest-cov" }, @@ -1111,6 +1121,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "apscheduler", specifier = ">=3.10.4" }, + { name = "bump2version", marker = "extra == 'dev'" }, { name = "cryptography", specifier = ">=43.0.1" }, { name = "fastapi", specifier = ">=0.114.0" }, { name = "jinja2", specifier = ">=3.1.4" }, From 09d2560b2c635bbda7e3a7979342e5f62816e444 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 14:45:23 +0530 Subject: [PATCH 02/18] uv sync before running bump2version --- justfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index cacc1ac2..9d8746e8 100644 --- a/justfile +++ b/justfile @@ -112,14 +112,16 @@ bumpver level="patch": #!/bin/bash set -eou pipefail + uv sync --extra dev + # get the current and new version - CURRENT_VERSION=$(uv run --extra dev bump2version --dry-run --list {{ level }} | grep current_version | cut -d'=' -f2) - NEW_VERSION=$(uv run --extra dev bump2version --dry-run --list {{ level }} | grep new_version | cut -d'=' -f2) + CURRENT_VERSION=$(uv run bump2version --dry-run --list {{ level }} | grep current_version | cut -d'=' -f2) + NEW_VERSION=$(uv run bump2version --dry-run --list {{ level }} | grep new_version | cut -d'=' -f2) echo "Bumping version from $CURRENT_VERSION to $NEW_VERSION" # first bump version - uv run --extra dev bump2version {{ level }} + uv run bump2version {{ level }} # get an updated lock file uv lock From 0c8652165b134435044546fd3530179ffb861000 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 14:59:56 +0530 Subject: [PATCH 03/18] some changes to just --- justfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/justfile b/justfile index 9d8746e8..7f4ac44b 100644 --- a/justfile +++ b/justfile @@ -107,23 +107,28 @@ deploy keyfile remote="azureuser@20.168.10.234": build echo -e "{{ _green }}Deploy successful!{{ _nc }}" +# Bump version, commit and tag [group('build')] -bumpver level="patch": +bump-version level="patch": #!/bin/bash + # We need to uv.lock before we can commit the whole thing in the repo. + # DO not bump the version on the uv.lock file, else other packages with same version might get updated + set -eou pipefail + # sync everything uv sync --extra dev # get the current and new version - CURRENT_VERSION=$(uv run bump2version --dry-run --list {{ level }} | grep current_version | cut -d'=' -f2) - NEW_VERSION=$(uv run bump2version --dry-run --list {{ level }} | grep new_version | cut -d'=' -f2) - + BUMPVERS_CHANGES=$(uv run bump2version --dry-run --allow-dirty --list {{ level }}) + CURRENT_VERSION=$(echo "$BUMPVERS_CHANGES" | grep current_version | cut -d'=' -f2) + NEW_VERSION=$(echo "$BUMPVERS_CHANGES" | grep new_version | cut -d'=' -f2) echo "Bumping version from $CURRENT_VERSION to $NEW_VERSION" # first bump version uv run bump2version {{ level }} - # get an updated lock file + # update uv.lock file to reflect new package version uv lock # commit the changes From fc11eb92118e156cfb11071c35f5f8eeda8080b9 Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 17:04:20 +0700 Subject: [PATCH 04/18] add workflow for syftbox release Co-authored-by: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> --- .github/workflows/cd-release.yaml | 77 +++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/cd-release.yaml diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml new file mode 100644 index 00000000..aaae1b61 --- /dev/null +++ b/.github/workflows/cd-release.yaml @@ -0,0 +1,77 @@ +name: CD - SyftBox + +on: + schedule: + - cron: "0 12 * * 0" # At 12:00 UTC on every Sunday + + workflow_dispatch: + inputs: + none: + description: "Run SyftBox CD workflow" + required: false + +# Prevents concurrent runs of the same workflow +# while the previous run is still in progress +concurrency: + group: "CD - SyftBox" + cancel-in-progress: false + +jobs: + deploy-syftbox: + runs-on: ubuntu-latest + permissions: + contents: write # For tag and release notes. + + steps: + - name: Permission to home directory + run: | + sudo chown -R $USER:$USER $HOME + + - name: Checkout SyftBox repo with github token + uses: actions/checkout@v4 + with: + token: ${{ secrets.SYFTBOX_BOT_COMMIT_TOKEN }} + + # free 10GB of space + - name: Remove unnecessary files + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + docker image prune --all --force + docker builder prune --all --force + docker system prune --all --force + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install uv==0.4.1 tox==4.18.0 tox-uv==1.11.2 setuptools wheel twine bump2version PyYAML + uv --version + + - name: Install Just + uses: extractions/setup-just@v2 + with: + just-version: '1.36.0' + + - name: Bump the Version + run: | + just bump-version patch + + - name: Build the New Vesrion + run: | + just build + + - name: Push to https://pypi.org/ + run: | + twine upload -u __token__ -p ${{ secrets.OM_SYFT_PYPI_TOKEN }} dist/* + + - name: Push changes to SyftBox repo + run : | + git config user.name "${{ secrets.OM_BOT_NAME }}" + git config user.email "${{ secrets.OM_BOT_EMAIL }}" + git push origin main + + # todo: maybe add github release here \ No newline at end of file From 9ab518fc20d18f9f14038f390eae1de3514153aa Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 17:14:27 +0700 Subject: [PATCH 05/18] - remove some unnecessary dependencies - moving twine into dev dependencies Co-authored-by: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> --- .github/workflows/cd-release.yaml | 4 ++-- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index aaae1b61..50b76b46 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -48,7 +48,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install uv==0.4.1 tox==4.18.0 tox-uv==1.11.2 setuptools wheel twine bump2version PyYAML + pip install uv==0.4.1 uv --version - name: Install Just @@ -66,7 +66,7 @@ jobs: - name: Push to https://pypi.org/ run: | - twine upload -u __token__ -p ${{ secrets.OM_SYFT_PYPI_TOKEN }} dist/* + twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* - name: Push changes to SyftBox repo run : | diff --git a/pyproject.toml b/pyproject.toml index fe85da9b..042cbca4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ dev = [ "uv", "ruff", "bump2version", + "twine", ] From 7cdf94eb1ac6a3efbf9d231ea6f17e02a5be00e9 Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 17:20:39 +0700 Subject: [PATCH 06/18] remove some unnecessary CD steps Co-authored-by: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> --- .github/workflows/cd-release.yaml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index 50b76b46..f3fea37d 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -1,9 +1,6 @@ name: CD - SyftBox on: - schedule: - - cron: "0 12 * * 0" # At 12:00 UTC on every Sunday - workflow_dispatch: inputs: none: @@ -19,28 +16,13 @@ concurrency: jobs: deploy-syftbox: runs-on: ubuntu-latest - permissions: - contents: write # For tag and release notes. steps: - - name: Permission to home directory - run: | - sudo chown -R $USER:$USER $HOME - - name: Checkout SyftBox repo with github token uses: actions/checkout@v4 with: token: ${{ secrets.SYFTBOX_BOT_COMMIT_TOKEN }} - # free 10GB of space - - name: Remove unnecessary files - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - docker image prune --all --force - docker builder prune --all --force - docker system prune --all --force - - name: Set up Python uses: actions/setup-python@v5 with: From 82a9f8860171650d89d74f48da8ce87ba9e8fc60 Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 17:27:03 +0700 Subject: [PATCH 07/18] add a list input that let's us choose "patch" "minor" or "major" Co-authored-by: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> --- .github/workflows/cd-release.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index f3fea37d..2580baa5 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -3,9 +3,14 @@ name: CD - SyftBox on: workflow_dispatch: inputs: - none: - description: "Run SyftBox CD workflow" - required: false + bump_type: + description: 'Version bump type' + required: true + type: choice + options: + - patch + - minor + - major # Prevents concurrent runs of the same workflow # while the previous run is still in progress @@ -40,7 +45,7 @@ jobs: - name: Bump the Version run: | - just bump-version patch + just bump-version ${{ inputs.bump_type }} - name: Build the New Vesrion run: | From c2cd02c026ce0f0943f5ae6e8f11b85ab743f146 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 16:02:29 +0530 Subject: [PATCH 08/18] default + lint file --- .github/workflows/cd-release.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index 2580baa5..e2a16125 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -4,13 +4,14 @@ on: workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" required: true type: choice options: - - patch - - minor - - major + - patch + - minor + - major + default: patch # Prevents concurrent runs of the same workflow # while the previous run is still in progress @@ -41,12 +42,12 @@ jobs: - name: Install Just uses: extractions/setup-just@v2 with: - just-version: '1.36.0' + just-version: "1.36.0" - name: Bump the Version run: | just bump-version ${{ inputs.bump_type }} - + - name: Build the New Vesrion run: | just build @@ -56,9 +57,9 @@ jobs: twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* - name: Push changes to SyftBox repo - run : | + run: | git config user.name "${{ secrets.OM_BOT_NAME }}" git config user.email "${{ secrets.OM_BOT_EMAIL }}" git push origin main - # todo: maybe add github release here \ No newline at end of file + # todo: maybe add github release here From 2e205868950882b3439b49736412b70dce54a536 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 16:06:23 +0530 Subject: [PATCH 09/18] test run on pr - revert if no issues --- .github/workflows/cd-release.yaml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index e2a16125..021467c5 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -1,6 +1,10 @@ name: CD - SyftBox on: + # use this to test run it on the pr + # pull_request: + # branches: ["*"] + workflow_dispatch: inputs: bump_type: @@ -26,13 +30,14 @@ jobs: steps: - name: Checkout SyftBox repo with github token uses: actions/checkout@v4 - with: - token: ${{ secrets.SYFTBOX_BOT_COMMIT_TOKEN }} + # with: + # token: ${{ secrets.SYFTBOX_BOT_COMMIT_TOKEN }} - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -52,14 +57,12 @@ jobs: run: | just build - - name: Push to https://pypi.org/ - run: | - twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* - - - name: Push changes to SyftBox repo - run: | - git config user.name "${{ secrets.OM_BOT_NAME }}" - git config user.email "${{ secrets.OM_BOT_EMAIL }}" - git push origin main + # - name: Push to https://pypi.org/ + # run: | + # twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* - # todo: maybe add github release here + # - name: Push changes to SyftBox repo + # run: | + # git config user.name "${{ secrets.OM_BOT_NAME }}" + # git config user.email "${{ secrets.OM_BOT_EMAIL }}" + # git push origin main From d60119cecdf381c74c22c00c8579eecc518dc3cf Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 16:07:41 +0530 Subject: [PATCH 10/18] try --- .github/workflows/cd-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index 021467c5..2eb49493 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -2,8 +2,8 @@ name: CD - SyftBox on: # use this to test run it on the pr - # pull_request: - # branches: ["*"] + pull_request: + branches: ["*"] workflow_dispatch: inputs: From bb875e91b425c709f9eb248976769cb50fb457d7 Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 17:46:02 +0700 Subject: [PATCH 11/18] install twine on CD --- .github/workflows/cd-release.yaml | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index 2eb49493..4568b5c8 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -41,7 +41,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install uv==0.4.1 + pip install uv==0.4.1 twine uv --version - name: Install Just diff --git a/pyproject.toml b/pyproject.toml index 042cbca4..fe85da9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,6 @@ dev = [ "uv", "ruff", "bump2version", - "twine", ] From 242737ad75067fe03e3380c67f31e118f9f240f8 Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 17:46:29 +0700 Subject: [PATCH 12/18] Bump version 0.1.0 -> 0.1.1 --- .bumpversion.cfg | 2 +- pyproject.toml | 2 +- syftbox/__version__.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7a02aa92..26be79cd 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.0 +current_version = 0.1.1 parse = (?P\d+)\.(?P\d+)\.(?P\d+) serialize = {major}.{minor}.{patch} diff --git a/pyproject.toml b/pyproject.toml index fe85da9b..39562ae1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "syftbox" -version = "0.1.0" +version = "0.1.1" description = "Add your description here" readme = "README.md" requires-python = ">=3.9" diff --git a/syftbox/__version__.py b/syftbox/__version__.py index 222439bb..7c32cdf7 100644 --- a/syftbox/__version__.py +++ b/syftbox/__version__.py @@ -8,4 +8,4 @@ __title__ = "SyftBox" __description__ = "" __url__ = "https://openmined.org" -__version__ = "0.1.0" +__version__ = "0.1.1" diff --git a/uv.lock b/uv.lock index 1f642e21..9a1c237e 100644 --- a/uv.lock +++ b/uv.lock @@ -1089,7 +1089,7 @@ wheels = [ [[package]] name = "syftbox" -version = "0.1.0" +version = "0.1.1" source = { editable = "." } dependencies = [ { name = "apscheduler" }, From 836928c9df5f6a5c988cd2a54a0a44995a9035d6 Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 17:51:23 +0700 Subject: [PATCH 13/18] add config git user step before dumping version --- .github/workflows/cd-release.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index 4568b5c8..b543e722 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -32,6 +32,11 @@ jobs: uses: actions/checkout@v4 # with: # token: ${{ secrets.SYFTBOX_BOT_COMMIT_TOKEN }} + + - name: Configure git user + run: | + git config user.name "${{ secrets.OM_BOT_NAME }}" + git config user.email "${{ secrets.OM_BOT_EMAIL }}" - name: Set up Python uses: actions/setup-python@v5 @@ -63,6 +68,4 @@ jobs: # - name: Push changes to SyftBox repo # run: | - # git config user.name "${{ secrets.OM_BOT_NAME }}" - # git config user.email "${{ secrets.OM_BOT_EMAIL }}" # git push origin main From d02d1331aa1f4638fae274844b75dbf18cd4c891 Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 17:54:52 +0700 Subject: [PATCH 14/18] update uv on CD --- .github/workflows/cd-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index b543e722..3edd3a19 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -46,7 +46,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install uv==0.4.1 twine + pip install uv==0.4.19 twine uv --version - name: Install Just From 89ab7ff1d1b6f45fab98173213b5922d85858f70 Mon Sep 17 00:00:00 2001 From: khoaguin Date: Tue, 8 Oct 2024 18:04:02 +0700 Subject: [PATCH 15/18] add test_bump option --- .github/workflows/cd-release.yaml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index 3edd3a19..5e79d56d 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -8,14 +8,18 @@ on: workflow_dispatch: inputs: bump_type: - description: "Version bump type" - required: true + description: 'Version bump type' type: choice - options: - - patch - - minor - - major default: patch + options: + - patch + - minor + - major + + test_bump: + description: 'Perform a test bump version without pushing to pypi and repo' + type: boolean + default: false # TODO: change to false # Prevents concurrent runs of the same workflow # while the previous run is still in progress @@ -62,10 +66,12 @@ jobs: run: | just build - # - name: Push to https://pypi.org/ - # run: | - # twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* + - name: Push to https://pypi.org/ + if: ${{ inputs.test_bump == false }} + run: | + echo twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* - # - name: Push changes to SyftBox repo - # run: | - # git push origin main + - name: Push changes to SyftBox repo + if: ${{ inputs.test_bump == false }} + run: | + echo git push origin main From 2b3931ef51412eba79ca13b0e2c3907966997a48 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 16:49:14 +0530 Subject: [PATCH 16/18] revert test changes --- .github/workflows/cd-release.yaml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index 5e79d56d..0434a677 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -1,25 +1,21 @@ name: CD - SyftBox on: - # use this to test run it on the pr - pull_request: - branches: ["*"] - workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" type: choice default: patch options: - - patch - - minor - - major + - patch + - minor + - major test_bump: - description: 'Perform a test bump version without pushing to pypi and repo' + description: "Perform a test bump version without pushing to pypi and repo" type: boolean - default: false # TODO: change to false + default: false # Prevents concurrent runs of the same workflow # while the previous run is still in progress @@ -34,9 +30,9 @@ jobs: steps: - name: Checkout SyftBox repo with github token uses: actions/checkout@v4 - # with: - # token: ${{ secrets.SYFTBOX_BOT_COMMIT_TOKEN }} - + with: + token: ${{ secrets.SYFTBOX_BOT_COMMIT_TOKEN }} + - name: Configure git user run: | git config user.name "${{ secrets.OM_BOT_NAME }}" @@ -69,9 +65,9 @@ jobs: - name: Push to https://pypi.org/ if: ${{ inputs.test_bump == false }} run: | - echo twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* + twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* - name: Push changes to SyftBox repo if: ${{ inputs.test_bump == false }} run: | - echo git push origin main + git push origin main From ffd259e52a4ca0178072602ae78c6ac723d4e6ec Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 16:53:12 +0530 Subject: [PATCH 17/18] typos --- .github/workflows/cd-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-release.yaml b/.github/workflows/cd-release.yaml index 0434a677..3d6b028d 100644 --- a/.github/workflows/cd-release.yaml +++ b/.github/workflows/cd-release.yaml @@ -58,11 +58,11 @@ jobs: run: | just bump-version ${{ inputs.bump_type }} - - name: Build the New Vesrion + - name: Build syftbox run: | just build - - name: Push to https://pypi.org/ + - name: Push to pypi if: ${{ inputs.test_bump == false }} run: | twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/* From 07da29f98e3474aa988945be499315f83fc42b18 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Tue, 8 Oct 2024 16:55:25 +0530 Subject: [PATCH 18/18] Revert "Bump version 0.1.0 -> 0.1.1" This reverts commit 242737ad75067fe03e3380c67f31e118f9f240f8. --- .bumpversion.cfg | 2 +- pyproject.toml | 2 +- syftbox/__version__.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 26be79cd..7a02aa92 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.1 +current_version = 0.1.0 parse = (?P\d+)\.(?P\d+)\.(?P\d+) serialize = {major}.{minor}.{patch} diff --git a/pyproject.toml b/pyproject.toml index 39562ae1..fe85da9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "syftbox" -version = "0.1.1" +version = "0.1.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.9" diff --git a/syftbox/__version__.py b/syftbox/__version__.py index 7c32cdf7..222439bb 100644 --- a/syftbox/__version__.py +++ b/syftbox/__version__.py @@ -8,4 +8,4 @@ __title__ = "SyftBox" __description__ = "" __url__ = "https://openmined.org" -__version__ = "0.1.1" +__version__ = "0.1.0" diff --git a/uv.lock b/uv.lock index 9a1c237e..1f642e21 100644 --- a/uv.lock +++ b/uv.lock @@ -1089,7 +1089,7 @@ wheels = [ [[package]] name = "syftbox" -version = "0.1.1" +version = "0.1.0" source = { editable = "." } dependencies = [ { name = "apscheduler" },