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

Commit

Permalink
Remove option to initialize git repository since it is no longer very…
Browse files Browse the repository at this point in the history
… useful without astropy-helpers. Also remove remaining references to astropy-helpers.
  • Loading branch information
astrofrog committed Jan 28, 2020
1 parent 93f1066 commit 1c46da4
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 42 deletions.
12 changes: 0 additions & 12 deletions .travis-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ if [[ "${TRAVIS_PULL_REQUEST}" = "false" && "$TRAVIS_OS_NAME" = "linux" && $TASK
git checkout master
rsync -avz --delete --exclude .git/ ../packagename/ ./
git add -A

# Add astropy_helpers manually at the version in the cookiecutter template
git submodule add https://github.com/astropy/astropy-helpers astropy_helpers || true
git submodule update --init
cd astropy_helpers
# parse the json with jq to get the helpers version
helpers_version=$(jq -r ".cookiecutter.astropy_helpers_version" $HOME/.cookiecutter_replay/package-template.json)
git checkout $helpers_version
cp ah_bootstrap.py ../
cd ..
git add astropy_helpers ah_bootstrap.py

git commit --allow-empty -m "Update rendered version to ""$TRAVIS_COMMIT"
git push origin master
fi
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ env:
# being overridden here must exist in the cookiecutter.json
# See https://cookiecutter.readthedocs.io/en/0.9.1/advanced_usage.html#injecting-extra-context
- EXTRA_CONTEXT=''
- EXTRA_CONTEXT='include_example_cython_code=y'
- EXTRA_CONTEXT='use_compiled_extensions=y include_example_code=y'
- EXTRA_CONTEXT="package_name=AstropyProject" FOLDERNAME='AstropyProject'
- EXTRA_CONTEXT='_parent_project=sunpy'
- EXTRA_CONTEXT='minimum_python_version=3.5'
- TASK='render' FLAGS='--config-file rendered.yml --no-input' EXTRA_CONTEXT='include_example_cython_code=y initialize_git_repo=n license=Other'
- TASK='render' FLAGS='--config-file rendered.yml --no-input' EXTRA_CONTEXT='use_compiled_extensions=y include_example_code=y license=Other'

install:
- pip install sphinx-astropy cookiecutter gitpython tox
Expand Down
1 change: 0 additions & 1 deletion QUESTIONS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ a description of each of the prompts.
13. ``use_travis_ci``: If ``'y'`` the template will include an example ``.travis.yml`` file for the Travis CI service.
14. ``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.
15. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file.
16. ``initialize_git_repo``: If `gitpython <https://gitpython.readthedocs.io/en/stable/>`_ is installed this option will turn the rendered package into a git repository and add and initilize the ``astropy_helpers`` submodule.
1 change: 0 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"use_travis_ci": "y",
"use_read_the_docs": "y",
"sphinx_theme": "astropy-bootstrap",
"initialize_git_repo": "y",
"_parent_project": "astropy",
"_install_requires": "astropy",
"minimum_python_version": ["3.7", "3.6", "3.5"]
Expand Down
4 changes: 1 addition & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ Getting Started
The Astropy Package template uses the `Cookiecutter
<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
<https://gitpython.readthedocs.io/en/stable/>`_ to setup the
``astropy_helpers`` submodule. Depending on how you have Python
installed. Depending on how you have Python
installed these packages can be obtained through either pip or conda::

conda install -c conda-forge cookiecutter gitpython
Expand Down
1 change: 0 additions & 1 deletion docs/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ a description of each of the prompts:
#. ``use_travis_ci``: If ``'y'`` the template will include an example ``.travis.yml`` file for the Travis CI service.
#. ``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 <https://gitpython.readthedocs.io/en/stable/>`_ is installed this option will turn the rendered package into a git repository and add and initilize the ``astropy_helpers`` submodule.

Once the project has been set up, any of the values can still be `manually
updated <http://docs.astropy.org/en/latest/development/astropy-package-template.html>`_.
Expand Down
11 changes: 3 additions & 8 deletions docs/updating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ Updating Your Package
=====================

Once you have setup your project there will come a time when some things in the
package template change, new versions of ``astropy_helpers`` or updates to the
infrastructure you want to utilise. Updating your package with these changes is
a balance between maintaining parity with the original template and customising
your project to your needs.
package template change. Updating your package with these changes is a balance
between maintaining parity with the original template and customising your
project to your needs.


Using Cookiecutter to Update
Expand All @@ -28,10 +27,6 @@ settings configured to your package and then pull the changes into your package.

$ cookiecutter [--replay] gh:astropy/package-template -o /tmp

.. note::

You should choose 'n' for the "initialize_git_repo" question.

#. **Make a new branch**::

$ git checkout -b update_template
Expand Down
13 changes: 0 additions & 13 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,3 @@ def process_licence(licence_name):

if '{{ cookiecutter.use_compiled_extensions }}' != 'y' or '{{ cookiecutter.include_example_code }}' != 'y':
remove_file('{{ cookiecutter.module_name }}/example_c.pyx')

if '{{ cookiecutter.initialize_git_repo }}' == 'y':
try:
from git import Repo

new_repo = Repo.init(PROJECT_DIRECTORY)
new_repo.git.add('.')
new_repo.index.commit(
"Creation of {{ cookiecutter.package_name }} from astropy package template"
)

except ImportError:
print("gitpython is not installed so the repository will not be initialised.")
1 change: 0 additions & 1 deletion rendered.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ default_context:
use_travis_ci: "y"
use_read_the_docs: "y"
sphinx_theme: "astropy-bootstrap"
initialize_git_repo: "n"
minimum_python_version: "3.6"

0 comments on commit 1c46da4

Please sign in to comment.