Skip to content

Commit

Permalink
feature/use-latest-py-standards (#2)
Browse files Browse the repository at this point in the history
* Use latest py standards starting

* Finalize upgrade to newest py-standards

* Centralize builds
  • Loading branch information
evamaxfield authored Aug 3, 2022
1 parent 3eaf1a3 commit 875e0c8
Show file tree
Hide file tree
Showing 19 changed files with 317 additions and 424 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
commit-message:
prefix: "ci(dependabot):"
53 changes: 0 additions & 53 deletions .github/workflows/build-main.yml

This file was deleted.

28 changes: 17 additions & 11 deletions .github/workflows/check-pr.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
name: Test Repo Construction
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

# Cancel actions when new commits are pushed to PR
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
schedule:
# <minute [0,59]> <hour [0,23]> <day of the month [1,31]>
# <month of the year [1,12]> <day of the week [0,6]>
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
- cron: "27 14 * * 1"
workflow_dispatch:

jobs:
test-repo:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.1
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"
- uses: extractions/setup-just@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: |
pip install --upgrade pip
Expand All @@ -33,13 +39,13 @@ jobs:
- name: Install Generated Repo Dependencies
run: |
cd python-boilerplate
pip install -e .[ci]
git init
just install
- name: Run Generated Repo Build
run: |
cd python-boilerplate
just build
- name: Test Generate Docs
run: |
cd python-boilerplate
pip install -e .[docs]
just generate-docs
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cookiecutter Py Package

[![Example Repo Status](https://github.com/evamaxfield/cookiecutter-py-package/workflows/Generate%20and%20Test%20Example%20Repo/badge.svg)](https://github.com/evamaxfield/cookiecutter-py-package/tree/example-build)
[![Build Status](https://github.com/evamaxfield/cookiecutter-py-package/workflows/CI/badge.svg)](https://github.com/evamaxfield/cookiecutter-py-package/actions)

![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)

Expand All @@ -13,7 +13,7 @@ This repository is a template for `cookiecutter` to generate a Python project wh
contains following:

- A directory structure for your project
- Prebuilt `setup.py` file to help you develop and install your package
- Prebuilt `pyproject.toml` file to help you develop and install your package
- Includes basic examples of modules, tests, bin scripts, etc.
- Continuous integration
- Preconfigured to generate project documentation
Expand All @@ -34,13 +34,13 @@ and follow the instructions in `SETUP.md`.

## Features

- Uses `tox` (an environment manager) and `pytest` for local testing, simply run `tox`
or `just build` from a terminal in the project home directory.
- Runs tests on Windows, Mac, and Ubuntu on every branch and pull request commit using
- Uses `pytest` for local testing, simply run `just build` from a terminal.
- Runs tests on Windows, Mac, and Ubuntu on every commit to `main` and
every commit to branches with an open `pull request` to `main` using
GitHub Actions.
- Releases your Python Package to PyPI when you push to `main` after using
`bump2version`.
- Automatically builds documentation using Sphinx on every push to main and deploys
- Releases your Python Package to PyPI when you push to `main` after pushing a new
git tag with `just tag-for-release` and `just release`.
- Automatically builds documentation using Sphinx on every push to `main` and deploys
to GitHub Pages.
- Includes very minimal example code to get started.

Expand All @@ -50,16 +50,15 @@ just
```
```
Available recipes:
build # run tox / run tests and lint
build # run lint and then run tests
clean # clean all build, python, and lint files
default # list all available commands
generate-docs # generate Sphinx HTML documentation
install # install with all deps
lint # lint, format, and check all files
release # release a new version
serve-docs # generate Sphinx HTML documentation and serve to browser
tag-for-release version # tag a new version
test # run tests
update-from-cookiecutter # update this repo using latest cookiecutter-py-package
```

## Example

- For an example of the base project that is built from this template, go to the
[example-build branch](https://github.com/evamaxfield/cookiecutter-py-package/tree/example-build).
```
10 changes: 10 additions & 0 deletions {{ cookiecutter.project_slug }}/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
commit-message:
prefix: "ci(dependabot):"
74 changes: 0 additions & 74 deletions {{ cookiecutter.project_slug }}/.github/workflows/check-pr.yml

This file was deleted.

Loading

0 comments on commit 875e0c8

Please sign in to comment.