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 to the latest developments #62

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
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 CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Before you submit a pull request, check that it meets these guidelines:
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.

3. The pull request should work for Python 2.7, 3.5, 3.6 and 3.7, and for PyPy. Check
3. The pull request should work for Python 3.8, 3.9, 3.10, 3.11 and 3.12, and for PyPy. Check
https://travis-ci.org/audreyr/cookiecutter-pypackage/pull_requests
and make sure that the tests pass for all supported Python versions.

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Features
* Testing setup with ``unittest`` and ``pytest``
* Github-Actions_: Ready for Github Actions Continuous Integration testing
* Travis-CI_: Ready for Travis Continuous Integration testing
* Tox_ testing: Setup to easily test for Python 2.7, 3.5, 3.6, 3.7, 3.8
* Tox_ testing: Setup to easily test for Python 3.8, 3.9, 3.10, 3.11, 3.12
* Sphinx_ docs: Documentation ready for generation, automatic building and deploying to gh-pages (strongly recommended)
* Bumpversion_: Pre-configured version bumping with a single command
* Auto-release to PyPI_ when you push a new tag to master (strongly recommended)
Expand Down Expand Up @@ -199,8 +199,8 @@ things are files and folders and I'll give you a quick overview of what they
are/do.

* Tox_ (tox.ini): A system that can run all kinds of tests for you. For
instance, you can test your code on various versions (Python 2.7, 3.5,
3.6, 3.7, 3.8) and test your code on linters as well.
instance, you can test your code on various versions (Python 3.8,
3.9, 3.10, 3.11, 3.12) and test your code on linters as well.

* Travis-CI_ (travis.yml): A continuous integration system. That means every
time you push a commit it will simulate downloading your project, installing
Expand Down
3 changes: 1 addition & 2 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"full_name": "Your Name",
"email": "[email protected]",
"github_username": "username",
"github_owner": ["DAI-Lab", "HDI-Project", "D3-AI", "data-dev", "sdv-dev", "{{ cookiecutter.github_username }}"],
"github_owner": ["DAI-Lab", "HDI-Project", "sintel-dev", "data-dev", "{{ cookiecutter.github_username }}"],
"project_name": "Python Boilerplate",
"package_name": "{{ cookiecutter.project_name.lower().replace(' ', '-') }}",
"project_slug": "{{ cookiecutter.package_name.replace('-', '_') }}",
Expand All @@ -12,7 +12,6 @@
"license_owner_email": "{{ '[email protected]' if cookiecutter.github_username != cookiecutter.github_owner else cookiecutter.email }}",
"pypi_username": "{{ 'mit_dai_lab' if cookiecutter.github_username != cookiecutter.github_owner else cookiecutter.github_username }}",
"version": "0.1.0.dev0",
"support_py2": "n",
"ci_provider": ["Github Actions", "Travis CI", "No continuous integration"],
"use_pypi_with_ci": "n",
"use_ghpages_with_ci": "y",
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.repository_name}}/.github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.8

- name: Install dependencies
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
python-version: '3.8'

- name: Build
run: |
Expand Down
110 changes: 99 additions & 11 deletions {{cookiecutter.repository_name}}/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Run Tests

on:
Expand All @@ -7,32 +10,117 @@ on:
branches: [ master ]

jobs:
build:
lint:
runs-on: {{ '${{ matrix.os }}' }}
strategy:
matrix:
python-version: [3.8]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v2
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install package
run: pip install invoke .[dev]
- name: invoke lint
run: invoke lint


docs:
runs-on: {{ '${{ matrix.os }}' }}
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v1
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: {{ '${{ matrix.python-version }}' }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Install package
run: pip install .[dev]
- name: make docs
run: make docs

- name: Test with tox
run: tox

{%- if cookiecutter.use_codecov_with_ci == 'y' %}
readme:
runs-on: {{ '${{ matrix.os }}' }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v2
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install package and dependencies
run: pip install invoke rundoc .
- name: invoke readme
run: invoke readme


unit:
runs-on: {{ '${{ matrix.os }}' }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v2
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install package and dependencies
run: pip install invoke .[test]
- name: invoke unit
run: invoke unit

{%- if cookiecutter.use_codecov_with_ci == 'y' %}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
{%- endif %}


minimum:
runs-on: {{ '${{ matrix.os }}' }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v2
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install package and dependencies
run: pip install invoke .[test]
- name: invoke minimum
run: invoke minimum


tutorials:
runs-on: {{ '${{ matrix.os }}' }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v2
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install package and dependencies
run: pip install invoke jupyter matplotlib .
- name: invoke tutorials
run: invoke tutorials
16 changes: 7 additions & 9 deletions {{cookiecutter.repository_name}}/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ dist: trusty
language: python
python:
- 3.8
- 3.7
- 3.6
- 3.5
{%- if cookiecutter.support_py2 == 'y' %}
- 2.7
{%- endif %}
- 3.9
- 3.10
- 3.11
- 3.12

matrix:
include:
- python: 3.7
- python: 3.8
dist: xenial
sudo: required

Expand Down Expand Up @@ -46,7 +44,7 @@ deploy:
on:
tags: true
repo: {{ cookiecutter.github_owner }}/{{ cookiecutter.repository_name }}
python: 3.7
python: 3.8
{%- endif %}
{% if cookiecutter.use_ghpages_with_ci == 'y' %}
# Automatically build and deploy documentation to GitHub Pages after every
Expand All @@ -62,5 +60,5 @@ deploy:
target-branch: gh-pages
on:
branch: master
python: 3.7
python: 3.8
{%- endif %}
13 changes: 0 additions & 13 deletions {{cookiecutter.repository_name}}/MANIFEST.in

This file was deleted.

Loading