Skip to content

Commit

Permalink
Update cookiecutter for Girder v5
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmullen committed Mar 26, 2024
1 parent 5cd363b commit b906315
Show file tree
Hide file tree
Showing 9 changed files with 2,188 additions and 157 deletions.
2 changes: 1 addition & 1 deletion {{cookiecutter.package_name}}/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Run web tests
command: |
npm install
npm run lint
npm run build
working_directory: {{cookiecutter.package_slug}}/web_client
{%- endif %}

Expand Down
11 changes: 3 additions & 8 deletions {{cookiecutter.package_name}}/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
include LICENSE
include README.rst
include setup.py

graft {{ cookiecutter.package_slug }}
graft docs
prune test
global-exclude *.py[co] *.cmake __pycache__ node_modules
prune {{ cookiecutter.package_slug }}/web_client
include {{ cookiecutter.package_slug }}/web_client/dist/girder-plugin-{{ cookiecutter.package_name }}.umd.cjs
include {{ cookiecutter.package_slug }}/web_client/dist/style.css
9 changes: 5 additions & 4 deletions {{cookiecutter.package_name}}/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
readme = readme_file.read()

requirements = [
'girder>=3.0.0a1'
'girder>=5.0.0a1'
]

setup(
Expand All @@ -15,9 +15,10 @@
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
description='{{ cookiecutter.short_description }}',
install_requires=requirements,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
{%- if cookiecutter.include_web_client_plugin == 'yes' %}
from pathlib import Path
{% endif %}
from girder import plugin


class GirderPlugin(plugin.GirderPlugin):
DISPLAY_NAME = '{{ cookiecutter.plugin_name.replace("\'", "\\\'") }}'
{%- if cookiecutter.include_web_client_plugin == 'yes' %}
CLIENT_SOURCE_PATH = 'web_client'{% endif %}

def load(self, info):
# add plugin loading logic here
{%- if cookiecutter.include_web_client_plugin == 'yes' %}
plugin.registerPluginStaticContent(
plugin='{{ cookiecutter.package_slug }}',
css=['/style.css'],
js=['/girder-plugin-{{ cookiecutter.package_name }}.umd.cjs'],
staticDir=Path(__file__).parent / 'web_client' / 'dist',
tree=info['serverRoot'],
)
{%- else %}
pass
{%- endif %}
Loading

0 comments on commit b906315

Please sign in to comment.