Skip to content

Commit

Permalink
Update template with uv and ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-hilden committed Jul 4, 2024
1 parent 0daa4b8 commit b115625
Show file tree
Hide file tree
Showing 26 changed files with 292 additions and 292 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ about: Report a problem with Package
labels: bug
---

<!--
Hi, thanks for submitting a bug report!
This is an example bug template to start with.
Please fill in information below.
-->

### Issue

This happened.

### Expected behavior

This should have happened instead.

### Steps to reproduce

If applicable and possible, please provide a
[minimal working example](https://stackoverflow.com/help/minimal-reproducible-example).
9 changes: 3 additions & 6 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Package chat
url: https://example.org
about: Our chat for help and general discussion
- name: Stack Overflow
url: https://stackoverflow.com/questions/tagged/package
about: Forum for asking and answering questions about Package
- name: GitHub discussions
url: https://github.com/felix-hilden/python-package/discussions
about: Q&A and general discussions
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ about: Request for a new feature
labels: enhancement
---

<!--
Hi, thanks for submitting a feature request!
What do you have in mind?
-->

(write here)
6 changes: 4 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<!--
Hi, thanks for submitting a pull request!
This is an example template to start with.
Please write a short summary of your changes and fill in information below.
If some checks don't apply, please check them regardless.
-->

Related issue: #XXX

- [ ] Tests written
- [ ] Tests written and passed
- [ ] Documentation and changelog entry written
- [ ] All `tox` checks passed with an appropriately configured environment
- [ ] All `tox` checks passed
16 changes: 9 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ on:
branches:
- master
tags-ignore:
- '*'
- "*"
pull_request:

jobs:
matrix:
strategy:
matrix:
python-version: [3.6, 3.7, 3.9]
python-version: ["3.9", "3.10", "3.11", "3.12"]
name: Pytest on ${{matrix.python-version}}
runs-on: ubuntu-latest

Expand All @@ -28,22 +28,24 @@ jobs:
- name: Install package
run: |
python -m pip install --upgrade pip
pip install .[tests]
pip install uv
uv pip install . -r requirements/test
- name: Run test suite
run: pytest

full-build:
name: Full 3.8 build
name: Full build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.12"
- name: Install package
run: |
python -m pip install --upgrade pip
pip install .[dev]
pip install uv
uv pip install . -r requirements/dev
- name: Run tox environments
run: tox
76 changes: 59 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,69 @@
# See for more potential targets to ignore:
# https://github.com/github/gitignore/blob/master/Python.gitignore

# Python
# Python files
__pycache__/
*.py[cod]
**__pycache__/
build/
dist/
*.egg-info/
*$py.class
*.so
__pypackages__/

# Editors
.idea/
.vim/
# Distribution / packaging
.pypirc
.Python
/build/
/develop-eggs/
/dist/
/downloads/
/eggs/
/.eggs/
/lib/
/lib64/
/parts/
/sdist/
/var/
/wheels/
/share/python-wheels/
/.installed.cfg
*.egg-info/
*.egg
/*.egg-info/
/MANIFEST

# Tools
# Testing
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
docs/build
.tox/
*.cover
*.py,cover
cover/
.pytest_cache/

# Documentation
/docs/build/

# Environments
.env
.venv
env/
venv/
env.bak/
venv.bak/
/.env/
/.venv/
/env/
/venv/
/ENV/
/env.bak/
/venv.bak/

# Type checkers
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pytype/

# Editors
.idea/
.vim/
.vscode/
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_install:
- pip install -r requirements/docs
- pip install .

sphinx:
builder: html
configuration: docs/src/conf.py
fail_on_warning: false

formats:
- htmlzip
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2021 Felix Hildén
Copyright (c) 2019-2024 Felix Hildén

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include readme.rst
include package/VERSION
include readme.rst tox.ini
global-exclude *.py[cod] __pycache__ *.so
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

4 changes: 3 additions & 1 deletion docs/src/404.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
=======
:orphan:

Package
=======

Oops! The page you are looking for was not found.
Maybe you'll find what you're looking for by searching the documentation
or returning to the `home page <rtd_>`_.
Expand Down
34 changes: 17 additions & 17 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
import sys
from pathlib import Path

_root = Path(os.path.realpath(__file__)).parent.parent.parent
sys.path.insert(0, _root)
from package import __version__

project = 'package'
author = 'Felix Hildén'
copyright = '2019-2021, Felix Hildén'
release = Path(_root, 'package', 'VERSION').read_text().strip()
# Insert package root to path
_src_dir = Path(os.path.realpath(__file__)).parent
_package_root = _src_dir.parent.parent / "src"
sys.path.insert(0, str(_package_root))
sys.path.insert(0, str(_src_dir))

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx_autodoc_typehints',
'sphinx_rtd_theme',
]
project = "package"
author = "Felix Hildén"
copyright = "2019-2024, Felix Hildén"
version = __version__
release = version

master_doc = 'index'
exclude_patterns = ['build']
autosummary_generate = True
html_theme = 'sphinx_rtd_theme'
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx_rtd_theme"]

html_theme = "sphinx_rtd_theme"
python_use_unqualified_type_names = True
autodoc_default_options = {"members": True, "undoc-members": True}
autodoc_typehints = "description"
1 change: 0 additions & 1 deletion package/VERSION

This file was deleted.

10 changes: 0 additions & 10 deletions package/__init__.py

This file was deleted.

52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "package"
description = "Python package template."
readme = "readme.rst"
license = {file = "LICENSE"}
dynamic = ["version"]

requires-python = ">=3.9"
dependencies = []

keywords = []
authors = [{name = "Felix Hildén", email = "[email protected]"}]
maintainers = [{name = "Felix Hildén", email = "[email protected]"}]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
]

[project.urls]
homepage = "https://github.com/felix-hilden/python-package"
download = "https://github.com/felix-hilden/python-package"
source = "https://github.com/felix-hilden/python-package"
issues = "https://github.com/felix-hilden/python-package/issues"
documentation = "https://github.com/felix-hilden/python-package"

[tool.setuptools.dynamic]
version = {attr = "package.__version__"}

[tool.pytest.ini_options]
python_files = "*.py"
testpaths = ["tests"]

[tool.coverage.run]
source = ["src"]
branch = true
command_line = "-m pytest"

[tool.coverage.report]
precision = 1
show_missing = true
skip_covered = true

[tool.ruff.lint]
ignore = ["D107", "D203", "D212", "D413"]

[tool.ruff.format]
skip-magic-trailing-comma = true
Loading

0 comments on commit b115625

Please sign in to comment.