Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cookiecutter for Girder v5 #18

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 6 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,11 @@
'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',
'Programming Language :: Python :: 3.12',
],
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