Skip to content

Commit

Permalink
switch to copier
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Jul 21, 2024
1 parent e003611 commit 63f090b
Show file tree
Hide file tree
Showing 19 changed files with 121 additions and 503 deletions.
12 changes: 0 additions & 12 deletions .bumpversion.cfg

This file was deleted.

10 changes: 10 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changes here will be overwritten by Copier
_commit: dfc65a1
_src_path: .
add_extension: python
email: [email protected]
github: python-project-templates
project_description: A pure-python project template
project_name: python template
python_version_primary: '3.11'
team: Python Project Template Authors
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ docs/* linguist-documentation
*.ipynb linguist-documentation
Makefile linguist-documentation

* text=auto eol=lf
*.md text=auto eol=lf
*.py text=auto eol=lf
*.toml text=auto eol=lf
*.yml text=auto eol=lf
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: Build Status

on:
Expand All @@ -7,8 +8,6 @@ on:
tags:
- v*
paths-ignore:
- docs/
- CONTRIBUTING.md
- LICENSE
- README.md
pull_request:
Expand All @@ -32,7 +31,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -82,3 +81,4 @@ jobs:
- name: Make dist
run: make dist
if: ${{ matrix.os == 'ubuntu-latest' }}

46 changes: 0 additions & 46 deletions .github/workflows/publish.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ __pycache__/

# C extensions
*.so
*.dll

# Distribution / packaging
.Python
Expand Down
45 changes: 0 additions & 45 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 Tim Paine
Copyright 2024 Python Project Template Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
28 changes: 0 additions & 28 deletions MANIFEST.in

This file was deleted.

36 changes: 11 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,28 @@ install: ## install library
.PHONY: lint lints fix format

lint: ## run python linter with ruff
python -m isort python_template setup.py --check
python -m ruff python_template setup.py
python -m ruff check python_template
python -m ruff format --check python_template

# Alias
lints: lint

fix: ## fix python formatting with ruff
python -m isort python_template setup.py
python -m ruff format python_template setup.py
python -m ruff check --fix python_template
python -m ruff format python_template

# alias
format: fix

################
# Other Checks #
################
.PHONY: check-manifest semgrep checks check annotate
.PHONY: check-manifest checks check annotate

check-manifest: ## check python sdist manifest with check-manifest
check-manifest -v

semgrep: ## check for possible errors with semgrep
semgrep ci --config auto

checks: check-manifest semgrep
checks: check-manifest

# Alias
check: checks
Expand All @@ -59,38 +56,27 @@ test: ## run python tests
python -m pytest -v python_template/tests --junitxml=junit.xml

coverage: ## run tests and collect test coverage
python -m pytest -v python_template/tests --junitxml=junit.xml --cov=python_template --cov-branch --cov-fail-under=75 --cov-report term-missing --cov-report xml
python -m pytest -v python_template/tests --junitxml=junit.xml --cov=python_template --cov-branch --cov-fail-under=50 --cov-report term-missing --cov-report xml

# Alias
tests: test

########
# DOCS #
########
.PHONY: docs show-docs

docs: ## build html documentation
make -C ./docs html

show-docs: ## show docs with running webserver
cd ./docs/_build/html/ && PYTHONBUFFERED=1 python -m http.server | sec -u "s/0\.0\.0\.0/$$(hostname)/g"

###########
# VERSION #
###########
.PHONY: show-version patch minor major

show-version: ## show current library version
bump2version --dry-run --allow-dirty setup.py --list | grep current | awk -F= '{print $2}'
@bump-my-version show current_version

patch: ## bump a patch version
bump2version patch
@bump-my-version bump patch

minor: ## bump a minor version
bump2version minor
@bump-my-version bump minor

major: ## bump a major version
bump2version major
@bump-my-version bump major

########
# DIST #
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Python Project Template
# python template

A pure-python project template

[![Build Status](https://github.com/python-project-templates/python/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/python-project-templates/python/actions?query=workflow%3A%22Build+Status%22)
[![codecov](https://codecov.io/gh/python-project-templates/python/branch/main/graph/badge.svg)](https://codecov.io/gh/python-project-templates/python)
[![License](https://img.shields.io/github/license/python-project-templates/python)](https://github.com/python-project-templates/python)
[![PyPI](https://img.shields.io/pypi/v/python_template.svg)](https://pypi.python.org/pypi/python_template)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/python-project-templates/python/main?urlpath=lab)
[![Build Status](https://github.com/python-project-templates/python-template/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/python-project-templates/python-template/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/python-project-templates/python-template/branch/main/graph/badge.svg)](https://codecov.io/gh/python-project-templates/python-template)
[![License](https://img.shields.io/github/license/python-project-templates/python-template)](https://github.com/python-project-templates/python-template)
[![PyPI](https://img.shields.io/pypi/v/python-template.svg)](https://pypi.python.org/pypi/python-template)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/python-project-templates/python-template/main?urlpath=lab)

## Overview


> \[!NOTE\]
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).
1 change: 0 additions & 1 deletion docs/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api.md

This file was deleted.

Loading

0 comments on commit 63f090b

Please sign in to comment.