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

Simplify and document better #6

Merged
merged 18 commits into from
Sep 27, 2016
Merged

Conversation

jasongrout
Copy link
Contributor

I think the purpose of the cookie cutter is to be very opinionated, to set some conventions for packages. Accordingly, I simplified all of the names down to a single extension_name setting.

I also added some readme files.


```
cookiecutter https://github.com/jupyter/jupyterlab-extension-cookiecutter
```

A very simple working extension, written in common JavaScript, is included in
the ``lib/`` directory. Use this example to build your own extension.
A very simple working extension, written in Javascript using CommonJS modules, is included in the ``lib/`` directory. Use this example to build your own extension.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's flip line 19 and 21.

Add a heading:

A simple example

The lib/ directory includes a very simple example of a working extension, written in JavaScript using CommonJS modules. Use this example as a guide to build your own extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure that works!


## Package names

JupyterLab extensions generated by this cookie cutter recipe are composed of both a python package and an npm package. The npm package is declared as a private package, so it cannot be published to the public npm package repository. The npm package is used to retrieve npm dependencies and provide a framework for the bundling of the javascript. The python package is published to the PyPI python package repository, and contains the generated JupyterLab extension Javascript bundle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cookiecutter template creates a JupyterLab extension composed of a Python package and an npm package:

  • The npm package is declared as a private package, so it cannot be published to the public npm package repository. The npm package is used to retrieve npm dependencies and provide a framework for the bundling of the JavaScript.
  • The Python package is published to PyPI, the Python package repository, and contains the generated JupyterLab extension JavaScript bundle.

Thanks to @willingc for review suggestions.

JupyterLab extensions generated by this cookie cutter recipe are composed of both a python package and an npm package. The npm package is declared as a private package, so it cannot be published to the public npm package repository. The npm package is used to retrieve npm dependencies and provide a framework for the bundling of the javascript. The python package is published to the PyPI python package repository, and contains the generated JupyterLab extension Javascript bundle.

To lessen confusion between the different packages, this recipe sets the extension name, the python package name, and the npm package name all to the same thing. We also use the python package name as the python module name. A consequence of this is that the extension name should be a valid python import name (e.g., cannot contain dashes).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To simplify the developer experience and lessen confusion between the different packages, the cookiecutter template unifies the extension name, the Python package name, and the npm package name to the same name. Make sure to use a valid Python name (i.e. cannot contain dashes) for the extension name since the extension is used as a Python module as well as a Python package.


### Clean the repository

To ensure a clean build, you can remove all non-tracked files with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... build, remove all non-tracked files using the following command from the repository's root directory:

git clean -xfdi
```

This would ask you for confirmation before removing all untracked files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would will

### Create the release

We publish a Python source package and a Python universal binary wheel.
See the Python docs on [package uploading](https://packaging.python.org/distributing/#uploading-your-project-to-pypi)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs documentation


We publish a Python source package and a Python universal binary wheel.
See the Python docs on [package uploading](https://packaging.python.org/distributing/#uploading-your-project-to-pypi)
for twine setup instructions and for why twine is the recommended uploading method.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link twine

Use GitHub since there are no docs for twine

@willingc
Copy link
Contributor

@jasongrout Looks good. A few comments to make it easier for folks using the template.

Simple is better than complex. @danielballan thoughts?

@jasongrout
Copy link
Contributor Author

@willingc
Copy link
Contributor

Will review RELEASE.md now 👍

@@ -0,0 +1,38 @@
# Making a {{ cookiecutter.extension_name }} release

This document guides a contributor through creating a release of {{ cookiecutter.extension_name }}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps instead of contributor this should be "extension maintainer"

This document guides a contributor through creating a release of {{ cookiecutter.extension_name }}.


We publish a Python source package and a Python universal binary wheel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This process creates and publishes...


## Remove generated files

Do `npm run clean` to remove any old Javascript builds. Delete the `dist/` folder to remove old python package builds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaScript builds, and delete .... Python ... :


## Build the package

First build the Javascript extension bundle, then build the python package and wheel.
Copy link
Contributor

@willingc willingc Sep 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the following, build the JavaScript extension bundle and the Python package and wheel:


## Upload the package

Upload the python package with [twine](https://github.com/pypa/twine). See the Python documentation on [package uploading](https://packaging.python.org/distributing/#uploading-your-project-to-pypi)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... the Python ...

@willingc
Copy link
Contributor

@jasongrout I like the changes. A few clarifications and dreaded capitalizations 😨

Thanks again to @willingc for suggestions.
@willingc
Copy link
Contributor

:shipit:

@jasongrout jasongrout merged commit 4c91f73 into jupyterlab:master Sep 27, 2016
@danielballan
Copy link
Collaborator

Great! I agree that one extension name is a good simplification here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants