From b74ff54dfa3a5f6dd01fd33e5955353817123b9c Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Wed, 21 Feb 2024 17:26:18 +0530 Subject: [PATCH 1/3] fix(build): pin hatchling version 2nd try --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9cbebb4b..4adac8b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ Source = "https://github.com/frappe/bench" [build-system] requires = [ - "hatchling>=1.6.0,<1.9.4", + "hatchling>=1.6.0,<1.7.0", ] build-backend = "hatchling.build" From 87b4b1fd2a6d4e04e51230f2558b2573395ed823 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Fri, 23 Feb 2024 11:17:39 +0530 Subject: [PATCH 2/3] fix: specify hatch version in release pin hatchling version to correct range --- .github/workflows/release.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3bc1cd5..30d79a15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: run: | npm install @semantic-release/git @semantic-release/exec --no-save python3 -m pip install wheel twine - python3 -m pip install git+https://github.com/pypa/hatch + python3 -m pip install git+https://github.com/pypa/hatch@hatch-v1.9.2 - name: Create Release env: diff --git a/pyproject.toml b/pyproject.toml index 4adac8b4..01db07b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ Source = "https://github.com/frappe/bench" [build-system] requires = [ - "hatchling>=1.6.0,<1.7.0", + "hatchling>=1.6.0,<=1.21.0", ] build-backend = "hatchling.build" From 7c64aa3d94723bd30afee519c133689e0bc800d4 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Fri, 23 Feb 2024 16:20:21 +0100 Subject: [PATCH 3/3] fix(build): support pyproject version (#1502) * fix(build): support pyproject version * refactor: use util for parsing pyproject --------- Co-authored-by: Ankush Menat --- bench/utils/app.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bench/utils/app.py b/bench/utils/app.py index 868dc3a6..5d3ec6f4 100644 --- a/bench/utils/app.py +++ b/bench/utils/app.py @@ -232,7 +232,7 @@ def get_app_name(bench_path: str, folder_name: str) -> str: config_py_path = os.path.join(apps_path, folder_name, "setup.cfg") setup_py_path = os.path.join(apps_path, folder_name, "setup.py") - + pyproject_path = os.path.join(apps_path, folder_name, "pyproject.toml") pyproject = get_pyproject(pyproject_path) if pyproject: @@ -278,12 +278,17 @@ def check_existing_dir(bench_path, repo_name): def get_current_version(app, bench_path="."): current_version = None repo_dir = get_repo_dir(app, bench_path=bench_path) + pyproject_path = os.path.join(repo_dir, "pyproject.toml") config_path = os.path.join(repo_dir, "setup.cfg") init_path = os.path.join(repo_dir, os.path.basename(repo_dir), "__init__.py") setup_path = os.path.join(repo_dir, "setup.py") try: - if os.path.exists(config_path): + pyproject = get_pyproject(pyproject_path) + if pyproject: + current_version = pyproject.get("project", {}).get("version") + + if not current_version and os.path.exists(config_path): from setuptools.config import read_configuration config = read_configuration(config_path)