From bec852891f54e296e6067524d97674bf895e3876 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 11 Nov 2024 17:26:30 +0000 Subject: [PATCH 01/19] Give label sync workflow write permissions for issues --- tox.ini | 2 +- .../.github/workflows/label_sync.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 46dead5..e433bf8 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = cookiecutter pytest-cookies pytest-venv - tox[test] + tox[testing] commands = !bake_cookies: pytest tests/ {posargs} diff --git a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml index 350832d..7f21775 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/label_sync.yml @@ -8,6 +8,11 @@ on: # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - cron: '0 0 * * *' # run every day at midnight UTC + +# Give permissions to write issue labels +permissions: + issues: write + jobs: label_sync: runs-on: ubuntu-latest From d964d67db6698f384a993e5a08149b52ad312d0a Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Fri, 15 Nov 2024 14:58:30 +0000 Subject: [PATCH 02/19] Adds project url options to cookiecutter --- cookiecutter.json | 15 +++++++++- tox.ini | 2 +- .../pyproject.toml | 30 +++++++++++++++---- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 86e6a43..6634a89 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,6 +5,11 @@ "author_name": "", "author_email": "", "project_url": "", + "sourcecode_url": "", + "download_url": "", + "documentation_url": "", + "changelog_url": "", + "issue_tracker_url": "", "license": [ "BSD 3-Clause", "GNU GPL v3+", @@ -30,5 +35,13 @@ "docs/_templates", "docs/_static", ".github/workflows/sub_package_update.yml" - ] + ], + "__prompts__" : { + "project_url": "Primary website for the project, leave blank for Sunpy Homepage", + "sourcecode_url": "Version control link for the project", + "download_url": "Pypi address for the project, optional", + "documentation_url": "Documentation url, optional", + "changelog_url": "Url to the changelog, optional", + "issue_tracker_url": "Url to the issue tracker, optional" + } } diff --git a/tox.ini b/tox.ini index e433bf8..46dead5 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = cookiecutter pytest-cookies pytest-venv - tox[testing] + tox[test] commands = !bake_cookies: pytest tests/ {posargs} diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index c743f14..7f88d87 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -27,11 +27,34 @@ dependencies = [ ] dynamic = ["version"] +# Okay strip the whitespace motherfucker! +[project.urls] +{% if cookiecutter.project_url -%} +Homepage = "{{ cookiecutter.project_url }}" +{% else -%} +Homepage = "https://sunpy.org" +{% endif -%} +{% if cookiecutter.sourcecode_url -%} +"Source Code" = "{{ cookiecutter.sourcecode_url }}" +{% endif -%} +{% if cookiecutter.download_url -%} +Download = "{{ cookiecutter.download_url }}" +{% endif -%} +{% if cookiecutter.documentation_url -%} +Documentation = "{{ cookiecutter.documentation_url }}" +{% endif -%} +{% if cookiecutter.changelog_url -%} +Changelog = "{{ cookiecutter.changelog_url }}" +{% endif -%} +{% if cookiecutter.issue_tracker_url -%} +"Issue Tracker" = "{{ cookiecutter.issue_tracker_url }}" +{% endif -%} + {% if cookiecutter.include_example_code == 'y' -%} [project.scripts] open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" -{% endif -%} +{% endif %} [project.optional-dependencies] tests = [ "pytest", @@ -46,11 +69,6 @@ docs = [ "packaging", ] -{%- if cookiecutter.project_url %} -[project.urls] -repository = "{{ cookiecutter.project_url }}" -{%- endif %} - [tool.setuptools] zip-safe = false include-package-data = true From 369d592fbb4d812546ad7da0b8d30687e9501842 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Tue, 26 Nov 2024 19:03:40 +0000 Subject: [PATCH 03/19] Adds projecturls baked cookies test --- tests/conftest.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 395ad61..61482f1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -97,6 +97,22 @@ def bake_examples_compiled_dev_version(cookies): return _handle_cookiecutter_errors(result) +@pytest.fixture +def bake_examples_url_extensions(cookies): + """ + setting url parameters + """ + result = cookies.bake(extra_context={ + "project_url": "https://sunpy.org", + "sourcecode_url": "https://github.com/sunpy/sunpy", + "download_url": "https://github.com/sunpy/sunpy/archive/master.zip", + "documentation_url": "https://sunpy.org/docs", + "changelog_url": "https://sunpy.org/changelog", + "issue_tracker_url": "https://github.com/sunpy/sunpy/issues" + }) + return _handle_cookiecutter_errors(result) + + def pytest_addoption(parser): # Add support for saving out rendered cookies to a specific location for inspection parser.addoption("--cookie-location", action="store", default=None) From 0c4213487c8f85bb99a7eea6e186263947b65eb1 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 26 Nov 2024 19:36:04 +0000 Subject: [PATCH 04/19] Update {{ cookiecutter.package_name }}/pyproject.toml Co-authored-by: Stuart Mumford --- {{ cookiecutter.package_name }}/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 7f88d87..b7d11a1 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -27,7 +27,6 @@ dependencies = [ ] dynamic = ["version"] -# Okay strip the whitespace motherfucker! [project.urls] {% if cookiecutter.project_url -%} Homepage = "{{ cookiecutter.project_url }}" From 6407d13deb56517a3ee6ab6c6bbdb45d7117dc20 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 10:13:15 +0000 Subject: [PATCH 05/19] Relocates the project.urls block in toml --- .../pyproject.toml | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index b7d11a1..a3131ed 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -27,6 +27,25 @@ dependencies = [ ] dynamic = ["version"] +{% if cookiecutter.include_example_code == 'y' -%} +[project.scripts] +open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" + +{% endif %} +[project.optional-dependencies] +tests = [ + "pytest", + "pytest-doctestplus", + "pytest-cov", + "pytest-xdist", +] +docs = [ + "sphinx", + "sphinx-automodapi", + "sunpy-sphinx-theme", + "packaging", +] + [project.urls] {% if cookiecutter.project_url -%} Homepage = "{{ cookiecutter.project_url }}" @@ -49,25 +68,6 @@ Changelog = "{{ cookiecutter.changelog_url }}" "Issue Tracker" = "{{ cookiecutter.issue_tracker_url }}" {% endif -%} -{% if cookiecutter.include_example_code == 'y' -%} -[project.scripts] -open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" - -{% endif %} -[project.optional-dependencies] -tests = [ - "pytest", - "pytest-doctestplus", - "pytest-cov", - "pytest-xdist", -] -docs = [ - "sphinx", - "sphinx-automodapi", - "sunpy-sphinx-theme", - "packaging", -] - [tool.setuptools] zip-safe = false include-package-data = true From 2126cd4b5c35b1adc58748e0bc3d7571bda41976 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 10:23:17 +0000 Subject: [PATCH 06/19] Adds sourcecode/github processing in cookiecutteR --- cookiecutter.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cookiecutter.json b/cookiecutter.json index 6634a89..fea5b88 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,6 +6,7 @@ "author_email": "", "project_url": "", "sourcecode_url": "", + "github_repo": "{{ cookiecutter.sourcecode_url | replace('https://github.com/', '') }}", "download_url": "", "documentation_url": "", "changelog_url": "", @@ -39,6 +40,7 @@ "__prompts__" : { "project_url": "Primary website for the project, leave blank for Sunpy Homepage", "sourcecode_url": "Version control link for the project", + "github_repo": "Leave blank to pull form sourcecode_url or if not github", "download_url": "Pypi address for the project, optional", "documentation_url": "Documentation url, optional", "changelog_url": "Url to the changelog, optional", From 3c05b142b200136463c839538fe1fa828064830e Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:23:00 +0000 Subject: [PATCH 07/19] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index fea5b88..4c7dbd2 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -40,7 +40,7 @@ "__prompts__" : { "project_url": "Primary website for the project, leave blank for Sunpy Homepage", "sourcecode_url": "Version control link for the project", - "github_repo": "Leave blank to pull form sourcecode_url or if not github", + "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "download_url": "Pypi address for the project, optional", "documentation_url": "Documentation url, optional", "changelog_url": "Url to the changelog, optional", From 2166b211dda0d53302ba811a68ab6e8220b021b0 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:30:13 +0000 Subject: [PATCH 08/19] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 4c7dbd2..e408f24 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,7 +6,7 @@ "author_email": "", "project_url": "", "sourcecode_url": "", - "github_repo": "{{ cookiecutter.sourcecode_url | replace('https://github.com/', '') }}", + "github_repo": "{{ cookiecutter.sourcecode_url | replace('https://github.com/', '') if 'https://github.com/' in cookiecutter.sourcecode_url else '' }}", "download_url": "", "documentation_url": "", "changelog_url": "", From f99616a87a137cfbf3b4787bfe90a7504082c92c Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:30:23 +0000 Subject: [PATCH 09/19] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index e408f24..e594a73 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -42,7 +42,7 @@ "sourcecode_url": "Version control link for the project", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "download_url": "Pypi address for the project, optional", - "documentation_url": "Documentation url, optional", + "documentation_url": "Documentation URL, optional", "changelog_url": "Url to the changelog, optional", "issue_tracker_url": "Url to the issue tracker, optional" } From 57980062dd3e4626a31e5e775f227b1a0686d85c Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:30:35 +0000 Subject: [PATCH 10/19] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index e594a73..1c0f4ba 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -41,7 +41,7 @@ "project_url": "Primary website for the project, leave blank for Sunpy Homepage", "sourcecode_url": "Version control link for the project", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", - "download_url": "Pypi address for the project, optional", + "download_url": "PyPi address for the project, optional", "documentation_url": "Documentation URL, optional", "changelog_url": "Url to the changelog, optional", "issue_tracker_url": "Url to the issue tracker, optional" From ed2ca4c7894cd72421efe5814988c3b1f0f65708 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:30:47 +0000 Subject: [PATCH 11/19] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 1c0f4ba..3361c89 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -43,7 +43,7 @@ "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "download_url": "PyPi address for the project, optional", "documentation_url": "Documentation URL, optional", - "changelog_url": "Url to the changelog, optional", - "issue_tracker_url": "Url to the issue tracker, optional" + "changelog_url": "URL to the changelog, optional", + "issue_tracker_url": "URL to the issue tracker, optional" } } From 1ff00c7123f48e0950a996af015564d5c9bfb11b Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Thu, 28 Nov 2024 11:53:05 +0000 Subject: [PATCH 12/19] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 3361c89..c35f433 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -39,7 +39,7 @@ ], "__prompts__" : { "project_url": "Primary website for the project, leave blank for Sunpy Homepage", - "sourcecode_url": "Version control link for the project", + "sourcecode_url": "URL for source code, i.e. https://github.com/...", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "download_url": "PyPi address for the project, optional", "documentation_url": "Documentation URL, optional", From 8bdd26a970c75662aa6b9126e75c0cfd83bbe47a Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 15:18:21 +0000 Subject: [PATCH 13/19] Adds github slug option --- cookiecutter.json | 6 +++--- tests/conftest.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index c35f433..870e305 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,8 +5,8 @@ "author_name": "", "author_email": "", "project_url": "", - "sourcecode_url": "", - "github_repo": "{{ cookiecutter.sourcecode_url | replace('https://github.com/', '') if 'https://github.com/' in cookiecutter.sourcecode_url else '' }}", + "github_repo": "", + "sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if github_repo else '' }}", "download_url": "", "documentation_url": "", "changelog_url": "", @@ -39,8 +39,8 @@ ], "__prompts__" : { "project_url": "Primary website for the project, leave blank for Sunpy Homepage", - "sourcecode_url": "URL for source code, i.e. https://github.com/...", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", + "sourcecode_url": "URL for source code, i.e. https://github.com/...", "download_url": "PyPi address for the project, optional", "documentation_url": "Documentation URL, optional", "changelog_url": "URL to the changelog, optional", diff --git a/tests/conftest.py b/tests/conftest.py index 61482f1..9ad76af 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -104,7 +104,8 @@ def bake_examples_url_extensions(cookies): """ result = cookies.bake(extra_context={ "project_url": "https://sunpy.org", - "sourcecode_url": "https://github.com/sunpy/sunpy", + "github_repo": "sunpy/sunpy", + "sourcecode_url": "", "download_url": "https://github.com/sunpy/sunpy/archive/master.zip", "documentation_url": "https://sunpy.org/docs", "changelog_url": "https://sunpy.org/changelog", From ef5181e477fc6ffb17c548e51a3ee4369eb4ef0a Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 15:28:08 +0000 Subject: [PATCH 14/19] Fixes stray `github_repo` --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 870e305..0a8c307 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,7 +6,7 @@ "author_email": "", "project_url": "", "github_repo": "", - "sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if github_repo else '' }}", + "sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if cookiecutter.github_repo else '' }}", "download_url": "", "documentation_url": "", "changelog_url": "", From 0bb9b8090d1bd6e1ed17d023c89f937b16d29cd8 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 15:36:57 +0000 Subject: [PATCH 15/19] Adds new test to fixture list --- tests/conftest.py | 5 ++++- {{ cookiecutter.package_name }}/pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9ad76af..f42cd25 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,8 @@ def cookiejar_no_examples(request): @pytest.fixture(params=["bake_examples_compiled", "bake_examples", - "bake_examples_compiled_dev_version"]) + "bake_examples_compiled_dev_version", + "bake_examples_url_extensions"]) def cookiejar_examples(request): """ Templates rendered with the examples @@ -103,6 +104,8 @@ def bake_examples_url_extensions(cookies): setting url parameters """ result = cookies.bake(extra_context={ + "author_name": "test", + "include_example_code": "y", "project_url": "https://sunpy.org", "github_repo": "sunpy/sunpy", "sourcecode_url": "", diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index a3131ed..744b779 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -31,7 +31,7 @@ dynamic = ["version"] [project.scripts] open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" -{% endif %} +{%- endif %} [project.optional-dependencies] tests = [ "pytest", From 065ebd1ace87a1bbda62ac38667f792de9bf3800 Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 28 Nov 2024 15:36:57 +0000 Subject: [PATCH 16/19] Adds new test to fixture list --- tests/conftest.py | 5 ++++- {{ cookiecutter.package_name }}/pyproject.toml | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9ad76af..f42cd25 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,8 @@ def cookiejar_no_examples(request): @pytest.fixture(params=["bake_examples_compiled", "bake_examples", - "bake_examples_compiled_dev_version"]) + "bake_examples_compiled_dev_version", + "bake_examples_url_extensions"]) def cookiejar_examples(request): """ Templates rendered with the examples @@ -103,6 +104,8 @@ def bake_examples_url_extensions(cookies): setting url parameters """ result = cookies.bake(extra_context={ + "author_name": "test", + "include_example_code": "y", "project_url": "https://sunpy.org", "github_repo": "sunpy/sunpy", "sourcecode_url": "", diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index a3131ed..4bb5405 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -31,7 +31,7 @@ dynamic = ["version"] [project.scripts] open_astronomy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main" -{% endif %} +{% endif -%} [project.optional-dependencies] tests = [ "pytest", @@ -52,8 +52,11 @@ Homepage = "{{ cookiecutter.project_url }}" {% else -%} Homepage = "https://sunpy.org" {% endif -%} +{% if cookiecutter.github_repo -%} +"GitHub Repo" = "{{ cookiecutter.github_repo }}" +{% endif -%} {% if cookiecutter.sourcecode_url -%} -"Source Code" = "{{ cookiecutter.sourcecode_url }}" +"Source Code" = "{{ https:/github.com/cookiecutter.github_repo | cookiecutter.sourcecode_url }}" {% endif -%} {% if cookiecutter.download_url -%} Download = "{{ cookiecutter.download_url }}" From e6ddd2280227d4197beeb53db8aa822e4f69736d Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 3 Dec 2024 13:42:34 +0000 Subject: [PATCH 17/19] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 0a8c307..2a2d3e3 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -41,7 +41,7 @@ "project_url": "Primary website for the project, leave blank for Sunpy Homepage", "github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.", "sourcecode_url": "URL for source code, i.e. https://github.com/...", - "download_url": "PyPi address for the project, optional", + "download_url": "PyPI address for the project, optional", "documentation_url": "Documentation URL, optional", "changelog_url": "URL to the changelog, optional", "issue_tracker_url": "URL to the issue tracker, optional" From 43d31ac081876e3ccc00ed9c76067e853a405862 Mon Sep 17 00:00:00 2001 From: Samuel Bennett Date: Tue, 3 Dec 2024 13:42:54 +0000 Subject: [PATCH 18/19] Update cookiecutter.json Co-authored-by: Stuart Mumford --- cookiecutter.json | 2 +- tests/conftest.py | 5 +-- tests/test_build_artifacts.py | 3 +- .../pyproject.toml | 31 +++++++++---------- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 2a2d3e3..54142bd 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -7,7 +7,7 @@ "project_url": "", "github_repo": "", "sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if cookiecutter.github_repo else '' }}", - "download_url": "", + "download_url": "https://pypi.org/project/{{ cookiecutter.package_name }}", "documentation_url": "", "changelog_url": "", "issue_tracker_url": "", diff --git a/tests/conftest.py b/tests/conftest.py index f42cd25..42bfa9b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -94,7 +94,9 @@ def bake_examples_compiled_dev_version(cookies): "author_name": "test", "include_cruft_update_github_workflow": "y", "use_extended_ruff_linting": "y", - }) + "download_url": "https://github.com/sunpy/sunpy/archive/master.zip", + "issue_tracker_url": "https://github.com/sunpy/sunpy/issues", + }) return _handle_cookiecutter_errors(result) @@ -108,7 +110,6 @@ def bake_examples_url_extensions(cookies): "include_example_code": "y", "project_url": "https://sunpy.org", "github_repo": "sunpy/sunpy", - "sourcecode_url": "", "download_url": "https://github.com/sunpy/sunpy/archive/master.zip", "documentation_url": "https://sunpy.org/docs", "changelog_url": "https://sunpy.org/changelog", diff --git a/tests/test_build_artifacts.py b/tests/test_build_artifacts.py index 0896594..7ebd631 100644 --- a/tests/test_build_artifacts.py +++ b/tests/test_build_artifacts.py @@ -12,7 +12,8 @@ ["bake_default", "bake_examples", "bake_examples_compiled", - "bake_examples_compiled_dev_version"]) + "bake_examples_compiled_dev_version", + "bake_examples_url_extensions"]) def test_render_template(request, bake_name, pytestconfig): bake = request.getfixturevalue(bake_name) cached_dir = pytestconfig.getoption("--cookie-location") diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 4bb5405..e78f5d8 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -47,29 +47,26 @@ docs = [ ] [project.urls] -{% if cookiecutter.project_url -%} +{%- if cookiecutter.project_url %} Homepage = "{{ cookiecutter.project_url }}" -{% else -%} +{%- else %} Homepage = "https://sunpy.org" -{% endif -%} -{% if cookiecutter.github_repo -%} -"GitHub Repo" = "{{ cookiecutter.github_repo }}" -{% endif -%} -{% if cookiecutter.sourcecode_url -%} -"Source Code" = "{{ https:/github.com/cookiecutter.github_repo | cookiecutter.sourcecode_url }}" -{% endif -%} -{% if cookiecutter.download_url -%} +{%- endif %} +{%- if cookiecutter.sourcecode_url %} +"Source Code" = "{{ cookiecutter.sourcecode_url }}" +{%- endif %} +{%- if cookiecutter.download_url %} Download = "{{ cookiecutter.download_url }}" -{% endif -%} -{% if cookiecutter.documentation_url -%} +{%- endif %} +{%- if cookiecutter.documentation_url %} Documentation = "{{ cookiecutter.documentation_url }}" -{% endif -%} -{% if cookiecutter.changelog_url -%} +{%- endif %} +{%- if cookiecutter.changelog_url %} Changelog = "{{ cookiecutter.changelog_url }}" -{% endif -%} -{% if cookiecutter.issue_tracker_url -%} +{%- endif %} +{%- if cookiecutter.issue_tracker_url %} "Issue Tracker" = "{{ cookiecutter.issue_tracker_url }}" -{% endif -%} +{%- endif %} [tool.setuptools] zip-safe = false From 39e29a92d61986affd2ce7b1844e26b58ee75d86 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 4 Dec 2024 13:44:54 +0000 Subject: [PATCH 19/19] Update cookiecutter.json --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 54142bd..0a9a1d2 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -10,7 +10,7 @@ "download_url": "https://pypi.org/project/{{ cookiecutter.package_name }}", "documentation_url": "", "changelog_url": "", - "issue_tracker_url": "", + "issue_tracker_url": "{{ 'https://github.com/' + cookiecutter.github_repo + '/issues/' if cookiecutter.github_repo else '' }}", "license": [ "BSD 3-Clause", "GNU GPL v3+",