Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Documentation Improvements #286

Merged
merged 11 commits into from
Mar 27, 2018
Merged

Conversation

Cadair
Copy link
Member

@Cadair Cadair commented Nov 29, 2017

closes #230

Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

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

Looks good but have a few comments

docs/index.rst Outdated

To start a package with the package template run::

cookiecutter gh:astropy/package-template
cookiecutter -c cookiecutter gh:astropy/package-template

This will ask you a series of questions, and result in a directory inside your
Copy link
Member

Choose a reason for hiding this comment

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

Here I wouldn't say question as such - I would say it asks for values of settings (better worded) and then link again to the page that explains the settings.

#########

You should register your package on https://travis-ci.org and modify the
``.travis.yml`` file to make the build pass. This will continuously test your
Copy link
Member

Choose a reason for hiding this comment

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

Can you clarify what kind of things need modifying? (give examples)

automatically tested, so that you notice when something breaks. For further
information see `here
<https://github.com/astropy/astropy/wiki/Continuous-Integration>`__ and for
lot's of example ``.travis.yml`` build configurations see `here
Copy link
Member

Choose a reason for hiding this comment

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

lots

Appveyor
########

Appveyor provides testing on the windows platform, if you want to enable this
Copy link
Member

Choose a reason for hiding this comment

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

windows -> Windows

Coveralls
#########

If you register your package with coveralls.io, you will need to uncomment the
Copy link
Member

Choose a reason for hiding this comment

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

Add a sentence to say what coveralls is


MOCK_MODULES = ['<name of package to mock>', '<name of package to mock>']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this bit about mocking isn't really needed anymore now that dependencies can be installed with conda. Maybe better to just mention how to set up a conda environment file instead.


$ git checkout -b update_template

3. **Copy the template over your package**: (replacing 'packagename' with your package name)::
#. **Copy the template over your package**: (replacing 'packagename' with your package name)::

$ cp -r /tmp/packagename ./
Copy link
Member

Choose a reason for hiding this comment

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

Wait but if you do that won't it make a folder with the name of the package inside the repo? Wouldn't it make more sense to do an rsync?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed this line to work (I tested it) and not use rsync because it's possible people wouldn't have that installed.

@Cadair
Copy link
Member Author

Cadair commented Dec 20, 2017

@astrofrog @eteq opinons on this? With the objective of moving these docs out of core for 3.0?

Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

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

Looks good! Super minor comments

docs/index.rst Outdated
Template) and asking you a series of :ref:`questions <options>` to create a set
of files and folders where your answers to the questions are pre-filled into the
correct places. The package template uses this to allow you to specify things
like your projects name as well as choose what parts and features of the
Copy link
Member

Choose a reason for hiding this comment

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

projects -> project's

docs/index.rst Outdated

This will ask you a series of questions, and result in a directory inside your
current working directory that has the name of your project.
This prompt you for a series of :ref:`options<options>`,current working
Copy link
Member

Choose a reason for hiding this comment

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

space after comma

eteq
eteq previously requested changes Feb 9, 2018
Copy link
Member

@eteq eteq left a comment

Choose a reason for hiding this comment

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

@Cadair - thanks for writing all this up - definitely a big step forward. Several inline comment, though.

In particular I'm concerned that if the user just follows these instructions as-is they might not really be forced to understand how the package files fit together. Some of the suggested additions I've given inline will hopefully help that? But it will be good to have someone test this once we've merged it and see if more explanation is needed.

docs/index.rst Outdated

pip install cookiecutter
pip install cookiecutter gitpython
Copy link
Member

Choose a reason for hiding this comment

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

I would swap the order of the conda and pip so that conda comes first. New users usually just do things in order, and if they are on conda it's safer for them to try that first.

docs/index.rst Outdated

This will ask you a series of questions, and result in a directory inside your
current working directory that has the name of your project.
This prompt you for a series of :ref:`options<options>`, current working
Copy link
Member

Choose a reason for hiding this comment

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

Something's wrong here, like maybe a line got dropped? I'm not sure what this sentence is trying to convey...?

Copy link
Member

Choose a reason for hiding this comment

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

Also, maybe have this say . See the :ref:options<options> page for more details on the various options. Or something like that so it's clear how to get help?

of the ``.travis.yml`` file can be found on the
`Travis CI <https://docs.travis-ci.com/user/for-beginners/>`__ website.

Continuous Integration services like Travis CI, continuously test your package
Copy link
Member

Choose a reason for hiding this comment

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

Maybe put this as the first paragraph of this section? since it's justifying why anyone would care about this section?

Appveyor
########

Appveyor provides testing on the Windows platform, if you want to enable this
Copy link
Member

Choose a reason for hiding this comment

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

Maybe Appveyor provides testing -> Appveyor is similar to Travis, but provides testing ?

Read the Docs
#############

If you want the documentation for your project to be hosted by `Read the Docs
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a sentence of motivation along the lines of "In addition to testing the code, it is often useful to build documentation continuously as the code is developed. Read the Docs is a web site that provides exactly this service." or something like that?

following entries in "Advanced Settings" for your package on `Read the Docs
<https://readthedocs.org>`_ should work:

- Activate ``Install your project inside a virtualenv using setup.py install``
Copy link
Member

Choose a reason for hiding this comment

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

Instead of "activate", maybe "push the button that says"? I didn't understand what "Activate" meant for quite a while. (And similar below)

#. ``use_read_the_docs``: If 'y' the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs.
#. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file.
#. ``initialize_git_repo``: If ``gitpython`` is installed this option will turn the rendered package into a git repository and add and initilize the ``astropy_helpers`` submodule.
#. ``astropy_helpers_version``: The version number of the ``astropy_helpers`` submodule to be used, only used if ``initialize_git_repo`` is true.
Copy link
Member

Choose a reason for hiding this comment

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

I think this is missing something at the end about how to update these options later. Of course it's a bit complicated since some or more complex than others, but presumably it can say something like "many of the options are in setup.cfg, go there to modify things. The rest create various files."

docs/index.rst Outdated
current working directory that has the name of your project.
This prompt you for a series of :ref:`options<options>`, current working
directory that has the name of your project. Once you have rendered the template
read :ref:`next-steps`.
Copy link
Member

Choose a reason for hiding this comment

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

Before the "next steps" I think you need to add something along the lines of step 7 of http://docs.astropy.org/en/latest/development/astropy-package-template.html#managing-the-template-files-via-git . That is, the person using this has to go and look at the examples and understand and then remove them.

Remember that part of the purpose of this is to educate people who have never done this before. It's very important that part of the template process be maintained, even if this all makes it a lot easier to manually skip over that.

Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Quite a few, but mostly nitpick comments. Once the docs is updated I would like to check it by giving it someone else who is not in our ecosystem yet to try to set up a package using these instructions.

@@ -18,7 +18,7 @@
"use_read_the_docs": "y",
"sphinx_theme": "astropy-boostrap",
"initialize_git_repo": "y",
"astropy_helpers_version": "v2.0",
"astropy_helpers_version": "v2.0.2",
Copy link
Member

Choose a reason for hiding this comment

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

we may want to branch this to be v3.0 or 2.0.4 depending whether the users package is python3 only or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure how easy that would be to do. Could you open it as a different issue?

docs/index.rst Outdated
The Astropy package template is designed to help quickly create new Python packages within the Astropy ecosystem.
The Astropy package template is designed to help quickly create new Python
packages within the Astropy ecosystem. This package mirrors the layout of the
main `Astropy_` repository, as well as reusing much of the helper code used to
Copy link
Member

Choose a reason for hiding this comment

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

'astropy core library' rather than 'main Astropy repository'

docs/index.rst Outdated
The Astropy package template is designed to help quickly create new Python
packages within the Astropy ecosystem. This package mirrors the layout of the
main `Astropy_` repository, as well as reusing much of the helper code used to
organize `Astropy_`.
Copy link
Member

Choose a reason for hiding this comment

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

astropy and many Astropy affiliated packages.

docs/index.rst Outdated
conda::
<http://cookiecutter.readthedocs.io/>`_ project to make it easier to customise
the template for your package. To use the package template you need cookiecutter
installed. The package template also optionally makes use of 'gitpython' to
Copy link
Member

Choose a reason for hiding this comment

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

maybe link to gitpython, too?

Next Steps
==========

Setting Up Continuous Integration
Copy link
Member

Choose a reason for hiding this comment

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

add (CI) to the end of the title


Once you have rendered your package and set it up on `GitHub
<https://github.com>`__ you may wish to enable Travis CI, Appveyor and Read the
Docs (configuration for these services is included in the template, but you
Copy link
Member

Choose a reason for hiding this comment

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

maybe also like all of travis, appveyor and rtd here, too?

Continuous Integration services like Travis CI, continuously test your package
for each commit, even pull requests against your main repository will be
automatically tested, so that you notice when something breaks. For further
information see `here
Copy link
Member

Choose a reason for hiding this comment

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

I was told several times that linking on the word here is not good practice. Not sure though how to rephrase the sentence to be better...

appveyor build is controlled by the ``appveyor.yml`` file included in the
template (by default).

Coveralls
Copy link
Member

Choose a reason for hiding this comment

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

maybe call it code coverage first? We're experimenting codecov, too, and on the long run may want to switch over? But changing the underlying service won't change the functionality and purpose of code coverage.

docs/options.rst Outdated
15. ``use_appveyor_ci``: If 'y' the template will include an example ``appveyor.yml`` file for the Appveyor CI service.
16. ``use_read_the_docs``: If 'y' the ``read_the_docs.yml`` and ``.rtd-environment.yml`` files will be included for using conda on Read the Docs.
17. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file.
#. ``package_name``: This is a human readable name for your package, like 'Astropy' or 'SunPy'.
Copy link
Member

Choose a reason for hiding this comment

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

do we maybe have a better example where this name is not the same of module_name?

docs/options.rst Outdated
#. ``long_description``: This is a multi-line description of your package.
#. ``author_name``: The name or names of the authors.
#. ``author_email``: A contact email for the authors.
#. ``license``: The license of your project.
Copy link
Member

Choose a reason for hiding this comment

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

project --> package
(given that you use package everywhere above)

@crawfordsm
Copy link
Member

@Cadair any chance you might have time to finished up this PR soon? I just started a new project last week and I didn't realize that this was working yet and used the old method. If this is now available, it would be great to advertise this. If you don't have time, I'd be happy to make a PR against your branch to take care of the edits if you'd be okay with that

@Cadair
Copy link
Member Author

Cadair commented Mar 24, 2018

Hey @crawfordsm I don't think I am particularly likely to get to this in the next few weeks. Between GSOC, pre-pyastro things and my actual job it's not high up my list unfortunately.

If you have the time to clear it up please feel free to send PRs :)

@crawfordsm
Copy link
Member

Okay I've made a PR against this -- I don't seem to have been able to merge directly into yours @Cadair so you'll have to merge my commits into this branch.

Docs (configuration for these services is included in the template, but you
could utilise others).
`Continuous Integration
<https://github.com/astropy/astropy/wiki/Continuous-Integration>`__ (CI)
Copy link
Member

Choose a reason for hiding this comment

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

this is a very obsolate wiki page, what about linking it to wikipedia instead (and maybe to the https://en.wikipedia.org/wiki/Continuous_testing page as the integration seems slightly different, or actually the travis docs really nice and brief yet informative on this: https://docs.travis-ci.com/user/for-beginners/#What-is-Continuous-Integration-(CI)%3F).

@crawfordsm crawfordsm dismissed eteq’s stale review March 27, 2018 23:19

offline approval

@crawfordsm crawfordsm merged commit e13e4fe into astropy:cookiecutter Mar 27, 2018
@Cadair Cadair deleted the gitpython_docs branch March 28, 2018 10:06
@Cadair
Copy link
Member Author

Cadair commented Mar 28, 2018

Thanks a lot @crawfordsm !

@bsipocz
Copy link
Member

bsipocz commented Mar 28, 2018

Thanks @Cadair and @crawfordsm, it's great to see this merged.

A few of my comments stayed unaddressed while being collapsed by github. Anyway, they are minor things and can be done in a follow-up PR if any of us gets there.

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

Successfully merging this pull request may close these issues.

git import error with cookiecutter
5 participants