From 1489b2847d65e64b9941a62369b49375021b41a0 Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Fri, 3 May 2024 10:11:42 -0400 Subject: [PATCH 1/3] fix: Add nodejs-bin as a dependency --- poetry.lock | 35 ++++++++++++++++++++++++++++++++++- pyproject.toml | 1 + 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 57051476..e21a921e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1740,6 +1740,39 @@ files = [ [package.dependencies] setuptools = "*" +[[package]] +name = "nodejs-bin" +version = "18.4.0a4" +description = "Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser." +optional = false +python-versions = "~=3.5" +files = [ + {file = "nodejs_bin-18.4.0a4-py3-none-macosx_10_9_x86_64.whl", hash = "sha256:16cb1abf7fe8c11c574e1e474d9f934a0df49a480290eae6e733d8bb09512e22"}, + {file = "nodejs_bin-18.4.0a4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:068ca987ed83ea1123775fafe5dc22d8f2ff920d7d31571e1bfe6fb1093833eb"}, + {file = "nodejs_bin-18.4.0a4-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:06cfeaa4d26eec94d8edb9927525ce94eb96dadc81f7d1daed42d1a7d003a4c9"}, + {file = "nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:431ee3529f4fb226ddcfd4f14cb37e7df31238c42dfd051f4bf8f0c21029b133"}, + {file = "nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:21f1f77ddc8fe05353bb6d6ee8e5a62edb3a8dcdb2740a5f9307fd8d9eef6691"}, + {file = "nodejs_bin-18.4.0a4-py3-none-win32.whl", hash = "sha256:59671fdc563dabb8be8a0b6dae4169d780482b3c9e0fba3f9aa2b7ee8d2261ac"}, + {file = "nodejs_bin-18.4.0a4-py3-none-win_amd64.whl", hash = "sha256:cbd509218b4b17f75ee7841f9c21d5cacc1626d3b823a652a6627dbad18228ec"}, +] + +[package.dependencies] +nodejs-cmd = {version = "*", optional = true, markers = "extra == \"cmd\""} + +[package.extras] +cmd = ["nodejs-cmd"] + +[[package]] +name = "nodejs-cmd" +version = "0.0.1a0" +description = "Additional Standard Command Line Commands For nodejs-bin" +optional = false +python-versions = "~=3.5" +files = [ + {file = "nodejs-cmd-0.0.1a0.tar.gz", hash = "sha256:fd71e7384892405bff93dcd203423cb80f5a8f15f37775dc7ee106388cc35da2"}, + {file = "nodejs_cmd-0.0.1a0-py3-none-any.whl", hash = "sha256:a88e06d0ff5d1768cbf89fb5eda3383fa3b229ff2a496f6898dae503a1a1dcba"}, +] + [[package]] name = "packaging" version = "24.0" @@ -3113,4 +3146,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4" -content-hash = "55203a528d163329b93cfd4eccbc0084cab4b5ab46847da55c76a49325f04859" +content-hash = "f9dce107da6a9e694a8c080e1402207b93d522be61600d79fae09d8cf167ccba" diff --git a/pyproject.toml b/pyproject.toml index a2c3c552..e89c9492 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ sh = ">=2.0.4" colorama = ">=0.4.6" inquirer = ">=3.1.3" pyyaml = ">=6.0.1" +nodejs-bin = {extras = ["cmd"], version = ">=18.4.0a4"} [tool.poetry.group.dev.dependencies] pytest = ">=7" From aa2cac41d98d0a5c47952b941e6525ba720e0eef Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Fri, 3 May 2024 10:30:36 -0400 Subject: [PATCH 2/3] fix small issues with prettier in the pipeline --- .github/workflows/release.yaml | 3 +++ src/scicookie/hooks/post_gen_project.py | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 62ba13e2..b8351a15 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,6 +32,9 @@ jobs: - name: Install deps run: poetry install + - name: (Re)Install nodejs + run: mamba install -n scicookie "nodejs>=20.12" + - name: Run semantic release (for tests) if: ${{ github.event_name != 'workflow_dispatch' }} env: diff --git a/src/scicookie/hooks/post_gen_project.py b/src/scicookie/hooks/post_gen_project.py index 1e3e8743..568015e3 100644 --- a/src/scicookie/hooks/post_gen_project.py +++ b/src/scicookie/hooks/post_gen_project.py @@ -284,21 +284,20 @@ def clean_up_linter(): if not USE_PRE_COMMIT: remove_project_file(".pre-commit-config.yaml") + # Auto format files with prettier + subprocess.call([ + "npx", + "--yes", + "prettier", + "--write", + "--ignore-unknown", + PROJECT_DIRECTORY + ]) + if not USE_PRETTIER: remove_project_file(".prettierrc.yaml") remove_project_file(".prettierignore") - # keep this one at the end - if USE_PRETTIER: - subprocess.call([ - "npx", - "--yes", - "prettier", - "--write", - "--ignore-unknown", - PROJECT_DIRECTORY - ]) - def prepare_git() -> None: git_https_origin = http2ssh("{{cookiecutter.git_https_origin}}") From 47045fe688fc69217ed9ff47a806434fa3191396 Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Fri, 3 May 2024 10:42:48 -0400 Subject: [PATCH 3/3] switch to nodejs-whell --- .github/workflows/release.yaml | 3 --- poetry.lock | 39 +++++++++------------------------- pyproject.toml | 3 ++- 3 files changed, 12 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b8351a15..62ba13e2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,9 +32,6 @@ jobs: - name: Install deps run: poetry install - - name: (Re)Install nodejs - run: mamba install -n scicookie "nodejs>=20.12" - - name: Run semantic release (for tests) if: ${{ github.event_name != 'workflow_dispatch' }} env: diff --git a/poetry.lock b/poetry.lock index e21a921e..446c6353 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1741,36 +1741,17 @@ files = [ setuptools = "*" [[package]] -name = "nodejs-bin" -version = "18.4.0a4" -description = "Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser." +name = "nodejs-wheel" +version = "20.12.2" +description = "unoffical Node.js package" optional = false -python-versions = "~=3.5" -files = [ - {file = "nodejs_bin-18.4.0a4-py3-none-macosx_10_9_x86_64.whl", hash = "sha256:16cb1abf7fe8c11c574e1e474d9f934a0df49a480290eae6e733d8bb09512e22"}, - {file = "nodejs_bin-18.4.0a4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:068ca987ed83ea1123775fafe5dc22d8f2ff920d7d31571e1bfe6fb1093833eb"}, - {file = "nodejs_bin-18.4.0a4-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:06cfeaa4d26eec94d8edb9927525ce94eb96dadc81f7d1daed42d1a7d003a4c9"}, - {file = "nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:431ee3529f4fb226ddcfd4f14cb37e7df31238c42dfd051f4bf8f0c21029b133"}, - {file = "nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:21f1f77ddc8fe05353bb6d6ee8e5a62edb3a8dcdb2740a5f9307fd8d9eef6691"}, - {file = "nodejs_bin-18.4.0a4-py3-none-win32.whl", hash = "sha256:59671fdc563dabb8be8a0b6dae4169d780482b3c9e0fba3f9aa2b7ee8d2261ac"}, - {file = "nodejs_bin-18.4.0a4-py3-none-win_amd64.whl", hash = "sha256:cbd509218b4b17f75ee7841f9c21d5cacc1626d3b823a652a6627dbad18228ec"}, -] - -[package.dependencies] -nodejs-cmd = {version = "*", optional = true, markers = "extra == \"cmd\""} - -[package.extras] -cmd = ["nodejs-cmd"] - -[[package]] -name = "nodejs-cmd" -version = "0.0.1a0" -description = "Additional Standard Command Line Commands For nodejs-bin" -optional = false -python-versions = "~=3.5" +python-versions = ">=3.7" files = [ - {file = "nodejs-cmd-0.0.1a0.tar.gz", hash = "sha256:fd71e7384892405bff93dcd203423cb80f5a8f15f37775dc7ee106388cc35da2"}, - {file = "nodejs_cmd-0.0.1a0-py3-none-any.whl", hash = "sha256:a88e06d0ff5d1768cbf89fb5eda3383fa3b229ff2a496f6898dae503a1a1dcba"}, + {file = "nodejs_wheel-20.12.2-py2.py3-none-macosx_10_9_x86_64.whl", hash = "sha256:5c9f7bd4f2149d2d17c9d19e8878c69ac97e0da71d1e4ed7250b15adf31fca70"}, + {file = "nodejs_wheel-20.12.2-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:5b93fe06341d1130dbf6ab9b458cb5983d6a9cf8e8ebc14e496b78aa9ae36c4e"}, + {file = "nodejs_wheel-20.12.2-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9099b220d99b35bb139e1155b0a9552600ade0e7a91cc5c68d70234e579bd5ce"}, + {file = "nodejs_wheel-20.12.2-py2.py3-none-win_amd64.whl", hash = "sha256:fc1e7591cb856e5d06b4f2be4b331b83809da82942cd7701c65092ac26a137c1"}, + {file = "nodejs_wheel-20.12.2.tar.gz", hash = "sha256:4219b35f95c265faa08606b22df885ab7b68cc6c0bfa9c90058698f8099acc46"}, ] [[package]] @@ -3146,4 +3127,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4" -content-hash = "f9dce107da6a9e694a8c080e1402207b93d522be61600d79fae09d8cf167ccba" +content-hash = "681b815a09502d43b60e7af56e0236af61273e14277d7fd34bc1d526f2af66a2" diff --git a/pyproject.toml b/pyproject.toml index e89c9492..7b4b29cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,8 @@ sh = ">=2.0.4" colorama = ">=0.4.6" inquirer = ">=3.1.3" pyyaml = ">=6.0.1" -nodejs-bin = {extras = ["cmd"], version = ">=18.4.0a4"} +nodejs-wheel = ">=20.12" + [tool.poetry.group.dev.dependencies] pytest = ">=7"