From d85e9178e2fadd733408d27fc54e8a1d6c41b222 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 5 Dec 2023 16:12:50 +0100 Subject: [PATCH 1/5] build: use flint as in upstream --- MANIFEST.in | 18 ------------------ dev-requirements.txt | 1 - pyproject.toml | 22 ++++++++++++++++++++++ requirements.txt | 2 -- setup.py | 19 ------------------- 5 files changed, 22 insertions(+), 40 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 dev-requirements.txt delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index c5d72b37..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,18 +0,0 @@ -include MANIFEST.in -include requirements.txt -include *.json -include *.md -include *.py -include *.txt -recursive-include ecommerce_integrations *.css -recursive-include ecommerce_integrations *.csv -recursive-include ecommerce_integrations *.html -recursive-include ecommerce_integrations *.ico -recursive-include ecommerce_integrations *.js -recursive-include ecommerce_integrations *.json -recursive-include ecommerce_integrations *.md -recursive-include ecommerce_integrations *.png -recursive-include ecommerce_integrations *.py -recursive-include ecommerce_integrations *.svg -recursive-include ecommerce_integrations *.txt -recursive-exclude ecommerce_integrations *.pyc \ No newline at end of file diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 859f243a..00000000 --- a/dev-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -responses~=0.16.0 diff --git a/pyproject.toml b/pyproject.toml index d8654aeb..1bc76484 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,25 @@ +[project] +name='ecommerce_integrations' +description='Ecommerce integrations for ERPNext' +authors = [ + { name = "Frappe Technologies Pvt Ltd", email = "developers@frappe.io"} +] +requires-python = ">=3.10" +readme = "./README.md" +dynamic = ["version"] + +dependencies = [ + "ShopifyAPI==12.3.0", # update after resolving pyjwt conflict in frappe + "boto3~=1.28.10", +] + +[project.license] +file = "./LICENSE" + +[build-system] +requires = ["flit_core >=3.4,<4"] +build-backend = "flit_core.buildapi" + [tool.black] line-length = 99 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 027e65b5..00000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -ShopifyAPI==12.3.0 # update after resolving pyjwt conflict in frappe -boto3~=1.28.10 diff --git a/setup.py b/setup.py deleted file mode 100644 index 8262dcc5..00000000 --- a/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -from setuptools import setup, find_packages - -with open('requirements.txt') as f: - install_requires = f.read().strip().split('\n') - -# get version from __version__ variable in ecommerce_integrations/__init__.py -from ecommerce_integrations import __version__ as version - -setup( - name='ecommerce_integrations', - version=version, - description='Ecommerce integrations for ERPNext', - author='Frappe', - author_email='developers@frappe.io', - packages=find_packages(), - zip_safe=False, - include_package_data=True, - install_requires=install_requires -) From c297fffc7386f672c224d80fc4cce4374845b9b7 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sat, 16 Dec 2023 22:47:56 +0100 Subject: [PATCH 2/5] fix(build): avoid dynamic metadata --- ecommerce_integrations/__init__.py | 4 +++- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ecommerce_integrations/__init__.py b/ecommerce_integrations/__init__.py index 30244104..63dfcac1 100644 --- a/ecommerce_integrations/__init__.py +++ b/ecommerce_integrations/__init__.py @@ -1 +1,3 @@ -__version__ = "1.17.0" +import importlib.metadata + +__version__ = importlib.metadata.version(__name__) diff --git a/pyproject.toml b/pyproject.toml index 1bc76484..be0775a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ authors = [ ] requires-python = ">=3.10" readme = "./README.md" -dynamic = ["version"] +version = "1.17.0" dependencies = [ "ShopifyAPI==12.3.0", # update after resolving pyjwt conflict in frappe From 0707b02d1b67e499d3898c72cf1379a223c63c5e Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sat, 16 Dec 2023 22:49:03 +0100 Subject: [PATCH 3/5] fix: add bench backwards compat --- setup.cfg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..a9f6f4fd --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[metadata] +# compatibility until https://github.com/frappe/bench/pull/1502 is more adopted +version = 1.17.0 From 6b02533c7c2a28958d4786b47a53a9ad07cf2b66 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 17 Dec 2023 00:26:26 +0100 Subject: [PATCH 4/5] fix: adapt releaserc --- .releaserc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.releaserc b/.releaserc index 8ee06582..2bb7fa45 100644 --- a/.releaserc +++ b/.releaserc @@ -10,12 +10,12 @@ "@semantic-release/release-notes-generator", [ "@semantic-release/exec", { - "prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" ecommerce_integrations/__init__.py' + "prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" pyproject.toml' } ], [ "@semantic-release/git", { - "assets": ["ecommerce_integrations/__init__.py"], + "assets": ["pyproject.toml"], "message": "chore(release): Bumped to Version ${nextRelease.version}\n\n${nextRelease.notes}" } ], From 4c02875805fc5da79e9f4f133d039185b7527351 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 19 Dec 2023 13:12:15 +0100 Subject: [PATCH 5/5] fix: correctly bump version on release --- .github/workflows/release.yml | 1 + .releaserc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 152f5bdf..539364e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,7 @@ jobs: - name: Setup dependencies run: | npm install @semantic-release/git @semantic-release/exec --no-save + pip install toml-cli - name: Create Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc b/.releaserc index 2bb7fa45..40a6b168 100644 --- a/.releaserc +++ b/.releaserc @@ -10,7 +10,7 @@ "@semantic-release/release-notes-generator", [ "@semantic-release/exec", { - "prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" pyproject.toml' + "prepareCmd": 'toml set --toml-path pyproject.toml project.version ${nextRelease.version}' } ], [