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 7e71c81
Show file tree
Hide file tree
Showing 26 changed files with 292 additions and 294 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
18 changes: 9 additions & 9 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 @@ -27,23 +27,23 @@ jobs:
python-version: ${{matrix.python-version}}
- name: Install package
run: |
python -m pip install --upgrade pip
pip install .[tests]
python -m pip install -U pip uv
uv pip install --system . -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]
python -m pip install -U pip uv
uv pip install --system . -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.

Loading

0 comments on commit 7e71c81

Please sign in to comment.