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

Refactor package template to follow APE 17 #438

Merged
merged 44 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ca9f807
Start refactoring package template to follow APE 17
astrofrog Jan 17, 2020
517e032
Updated CI configuration
astrofrog Jan 17, 2020
0b4895c
More improvements to infrastructure
astrofrog Jan 17, 2020
bef5dca
Fix Python version
astrofrog Jan 17, 2020
18b0b77
Fix syntax and spelling
astrofrog Jan 17, 2020
16785ed
Fix dependency
astrofrog Jan 17, 2020
2af909c
Added initial migration guide to Sphinx docs
astrofrog Jan 22, 2020
dce1c2c
More updates to migration guide
astrofrog Jan 24, 2020
3430879
More cleanup
astrofrog Jan 24, 2020
2c3659c
Remove .rtd-environment.yml file
astrofrog Jan 27, 2020
e265856
Fix syntax in cookiecutter.json and change default back for include_e…
astrofrog Jan 27, 2020
4c00c23
Remove questions that are no longer needed
astrofrog Jan 27, 2020
77a2ad6
More updates to migration guide
astrofrog Jan 27, 2020
bac1375
Added changelog entry
astrofrog Jan 27, 2020
38a4a95
Enable cron again
astrofrog Jan 27, 2020
33574f1
Simplified migration guide to avoid duplication with template
astrofrog Jan 27, 2020
4d8b5c7
More cleanup of the APE 17 migration guide
astrofrog Jan 27, 2020
471e6ca
Fix RTD config files
astrofrog Jan 27, 2020
b4a2092
Fix variable
astrofrog Jan 28, 2020
e1658a3
Make Step 0 sound less optional
astrofrog Jan 28, 2020
34ad4ce
Fix typo
astrofrog Jan 28, 2020
93f1066
Apply suggestions from code review
astrofrog Jan 28, 2020
1c46da4
Remove option to initialize git repository since it is no longer very…
astrofrog Jan 28, 2020
ce48548
Bump minimum supported version to 3.6 and add 3.8
astrofrog Jan 28, 2020
190fb6b
Added sentence about core package
astrofrog Jan 28, 2020
66cc65a
Improvements to migration guide following review
astrofrog Jan 28, 2020
7ef315e
Make sure repository is initialized on Travis
astrofrog Jan 28, 2020
b2dd969
Add back minimum_python_version to list of questions/options
astrofrog Jan 29, 2020
cf0b842
Give more example environments in the tox envlist
astrofrog Jan 29, 2020
c6dbd6e
Added support for specifying required and optional dependencies
astrofrog Jan 29, 2020
45122d6
Added description of new options
astrofrog Jan 29, 2020
a494822
Avoid repetition in setup.py
astrofrog Jan 29, 2020
65d57c1
Added new entry to .gitignore
astrofrog Jan 29, 2020
acfd4b3
Added long_description_content_type
astrofrog Jan 29, 2020
ef9573d
Added trailing slash in .gitignore for directory
astrofrog Jan 29, 2020
d62621c
Fixes/improvements to APE 17 migration guide
astrofrog Jan 30, 2020
970fe94
Make coverage testing opt-in
astrofrog Jan 30, 2020
c9ff2c4
Always use master branch for edit_on_github
astrofrog Jan 31, 2020
f14c673
Use root __version__ instead version
astrofrog Jan 31, 2020
3f9a571
Made pytest-astropy-header optional
astrofrog Jan 31, 2020
9da0a1c
Added a note about why the conftest.py file needs to be in the source…
astrofrog Jan 31, 2020
2b0155c
Added a note on release procedures and conda-forge
astrofrog Jan 31, 2020
1b812ef
Add missing ASTROPY_HEADER
astrofrog Jan 31, 2020
46622bb
Fix missing comma
astrofrog Jan 31, 2020
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
11 changes: 9 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
requirements_file: requirements.txt
version: 2

build:
image: latest

python:
version: 3.5
version: 3.7
install:
- requirements: requirements.txt
pllim marked this conversation as resolved.
Show resolved Hide resolved

formats: []
23 changes: 7 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# We set the language to c because python isn't supported on the MacOS X nodes
# on Travis. However, the language ends up being irrelevant anyway, since we
# install Python ourselves using conda.
language: c
language: python

os:
- linux

python: 3.8

env:
global:

# The following versions are the 'default' for tests, unless
# overridden underneath. They are defined here in order to save having
# to repeat them for all configurations.
- FOLDERNAME='packagename'
- PYTHON_VERSION=3.7
- CONDA_DEPENDENCIES='cython astropy sphinx'
- PIP_DEPENDENCIES='cookiecutter gitpython pytest-astropy sphinx-astropy'
- EVENT_TYPE='pull_request push'
- TASK='test'
- EXTRA_CONTEXT=''
- FLAGS=''
Expand All @@ -34,19 +29,15 @@ env:
- TASK='render' FLAGS='--config-file rendered.yml --no-input' EXTRA_CONTEXT='include_example_cython_code=y initialize_git_repo=n license=Other'

install:

- git clone --depth 1 git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
- pip install sphinx-astropy cookiecutter gitpython tox

script:
- cd docs ; make html ; cd ..
- cookiecutter --no-input ./ -o ../test $EXTRA_CONTEXT $FLAGS
- cd ../test/$FOLDERNAME
- if [[ $TASK == 'test' ]]; then python setup.py egg_info; fi
- if [[ $TASK == 'test' ]]; then python setup.py build; fi
- if [[ $TASK == 'test' ]]; then python setup.py build_docs; fi
- if [[ $TASK == 'test' ]]; then python setup.py test; fi
- if [[ $TASK == 'error_check' ]]; then python setup.py egg_info 2>&1 | grep "ERROR:"; fi
- if [[ $TASK == 'test' ]]; then tox -e py38-test; fi
- if [[ $TASK == 'test' ]]; then tox -e build_docs; fi
- if [[ $TASK == 'test' ]]; then tox -e codestyle; fi


after_success:
Expand Down
27 changes: 13 additions & 14 deletions QUESTIONS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ To use the package template run ``cookiecutter gh:astropy/package-template``,
once you have run this command you will be asked a series of questions. Below is
a description of each of the prompts.

1. ``package_name``: This is a human readable name for your package, like 'Astropy' or 'SunPy'.
2. ``module_name``: This is the name of your python package i.e. 'astropy' or 'sunpy'.
1. ``package_name``: This is a human readable name for your package, like ``Astropy`` or ``SunPy``.
2. ``module_name``: This is the name of your python package i.e. ``astropy`` or ``sunpy``.
3. ``short_description``: This is a one sentence description of your package.
4. ``long_description``: This is a multi-line description of your package.
pllim marked this conversation as resolved.
Show resolved Hide resolved
5. ``author_name``: The name or names of the authors.
6. ``author_email``: A contact email for the authors.
7. ``license``: The license of your project.
8. ``project_url``: Project website.
9. ``include_example_code``: This includes a set of example python and cython files showing you how to use the package template. If you choose 'n' then none of this will be included and you will have to populate the directory structure before you can import the package.
4. ``author_name``: The name or names of the authors.
5. ``author_email``: A contact email for the authors.
6. ``license``: The license of your package.
7. ``project_url``: Project website.
8. ``include_example_code``: This includes a set of example python files showing you how to use the package template. If you choose ``n`` then none of this will be included and you will have to populate the directory structure before you can import the package.
9. ``use_compiled_extensions``: Whether you plan to use compiled extensions in your package
10. ``include_cextern_folder``: The cextern folder should be used if you are including non-python C code.
11. ``edit_on_github_extension``: Set to "True" to enable the edit on GitHub sphinx extension.
11. ``edit_on_github_extension``: Set to ``True`` to enable the edit on GitHub sphinx extension.
12. ``github_project``: This is the GitHub identifier for the edit on GitHub extension and the changelog link extension.
13. ``project_version``: The current version number of your project.
14. ``use_travis_ci``: If 'y' the template will include an example ``.travis.yml`` file for the Travis CI service.
15. ``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.
16. ``sphinx_theme``: The value of the ``html_theme`` variable in the sphinx configuration file.
17. ``minimum_python_version``: Version string of minimum supported Python version
astrofrog marked this conversation as resolved.
Show resolved Hide resolved
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.
astrofrog marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions TEMPLATE_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ be copied over manually if desired.

- Removed Appveyor CI option. Use ``os: windows`` in Travis CI. [#420]

- Refactored the template to follow the recommendations in APE 17:
https://github.com/astropy/astropy-APEs/blob/master/APE17.rst [#438]

2.1 (unreleased)
----------------

Expand Down
12 changes: 3 additions & 9 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
"package_name": "packagename",
"module_name": "{{ cookiecutter.package_name|lower()|replace(' ', '_') }}",
"short_description": "{{ cookiecutter.package_name|replace('-', ' ')|replace('_', ' ') }}",
"long_description": "",
"author_name": "Astropy Developers",
"author_email": "",
"license": ["BSD 3-Clause", "GNU GPL v3+", "Apache Software Licence 2.0", "BSD 2-Clause", "Other"],
"project_url": "http://docs.astropy.org/projects/package-template/",
"project_version": "0.0.dev",
"include_example_code": "y",
"include_example_cython_code": "n",
"include_cextern_folder": "n",
"use_compiled_extensions": "y",
"include_example_code": "y",
"edit_on_github_extension": "False",
"github_project": "astropy/astropy",
"use_travis_ci": "y",
Expand All @@ -19,9 +17,5 @@
"initialize_git_repo": "y",
"_parent_project": "astropy",
"_install_requires": "astropy",
"_copy_without_render": [
"docs/_templates"
],
"minimum_python_version": ["3.7", "3.6", "3.5"],
"astropy_helpers_version": "v3.2.1"
"minimum_python_version": ["3.7", "3.6", "3.5"]
astrofrog marked this conversation as resolved.
Show resolved Hide resolved
}
Loading