Skip to content

Commit 9352df5

Browse files
authored
Merge branch 'master' into dependabot/github_actions/actions/cache-4
2 parents 7c9b75c + c731617 commit 9352df5

File tree

14 files changed

+1136
-1107
lines changed

14 files changed

+1136
-1107
lines changed

.devcontainer/devcontainer.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
2-
"name": "fastapi-37",
3-
"image": "mcr.microsoft.com/devcontainers/python:3.12",
2+
"name": "fastapi-38",
3+
"image": "mcr.microsoft.com/devcontainers/python:1-3.8-bookworm",
44
"features": {
5-
"ghcr.io/devcontainers/features/node:1": { "version": "latest" }
5+
"ghcr.io/devcontainers/features/node:1": {
6+
"version": "latest"
7+
}
68
},
79
"postCreateCommand": "pipx install poetry && poetry install",
8-
"forwardPorts": [2222]
9-
}
10+
"forwardPorts": [
11+
2222
12+
]
13+
}

.github/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
categories:
6+
- title: Breaking Changes 🛠
7+
labels:
8+
- Semver-Major
9+
- breaking-change
10+
- title: Exciting New Features 🎉
11+
labels:
12+
- Semver-Minor
13+
- enhancement
14+
- title: Other Changes
15+
labels:
16+
- "*"
17+
exclude:
18+
labels:
19+
- dependencies
20+
- title: 👒 Dependencies
21+
labels:
22+
- dependencies

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
max-parallel: 3
1515
matrix:
16-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
16+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
1717

1818
steps:
1919
- uses: actions/checkout@v4
@@ -23,7 +23,7 @@ jobs:
2323
python-version: ${{ matrix.python-version }}
2424

2525
- name: Init python poetry action
26-
uses: abatilo/actions-poetry@v2.3.0
26+
uses: abatilo/actions-poetry@v3.0.0
2727
with:
2828
poetry-version: 1.5.1
2929
- uses: actions/cache@v4

.github/workflows/publish-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
python-version: ${{ matrix.python-version }}
2828
# Avoid caching to be 100% confident things are working properly
2929
- name: Init python poetry action
30-
uses: abatilo/actions-poetry@v2.3.0
30+
uses: abatilo/actions-poetry@v3.0.0
3131
with:
3232
poetry-version: 1.5.1
3333

@@ -39,12 +39,12 @@ jobs:
3939

4040
# Publish docs to github pages
4141
- name: Setup Pages
42-
uses: actions/configure-pages@v4
42+
uses: actions/configure-pages@v5
4343
- name: Upload artifact
4444
uses: actions/upload-pages-artifact@v2
4545
with:
4646
# Upload entire repository
4747
path: './site'
4848
- name: Deploy to GitHub Pages
4949
id: deployment
50-
uses: actions/deploy-pages@v3
50+
uses: actions/deploy-pages@v4

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
python-version: ${{ matrix.python-version }}
2121
# Avoid caching to be 100% confident things are working properly
2222
- name: Init python poetry action
23-
uses: abatilo/actions-poetry@v2.3.0
23+
uses: abatilo/actions-poetry@v3.0.0
2424
with:
2525
poetry-version: 1.5.1
2626

.github/workflows/pull-request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-pull-request
1+
name: tests-pull-request
22

33
on:
44
pull_request:
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
max-parallel: 3
1313
matrix:
14-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
14+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
1515

1616
steps:
1717
- uses: actions/checkout@v4
@@ -21,7 +21,7 @@ jobs:
2121
python-version: ${{ matrix.python-version }}
2222

2323
- name: Init Python Poetry Action
24-
uses: abatilo/actions-poetry@v2.3.0
24+
uses: abatilo/actions-poetry@v3.0.0
2525
with:
2626
poetry-version: 1.5.1
2727
- uses: actions/cache@v4

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ test:
2424
format:
2525
black $(all_src)
2626
black -l 82 $(docs_src)
27-
ruff --fix $(all_src)
27+
ruff check --fix $(all_src)
2828

2929
.PHONY: lint
3030
lint:
31-
ruff $(all_src)
31+
ruff check $(all_src)
3232
black --check --diff $(all_src)
3333
black -l 82 $(docs_src) --check --diff
3434

@@ -47,11 +47,10 @@ testcov:
4747
fi
4848

4949
.PHONY: ci-v1 ## Run all CI validation steps without making any changes to code in pydantic v1
50-
5150
ci-v1: install-v1 lint test
5251

5352

54-
.PHONY: ci-v1 ## Run all CI validation steps without making any changes to code in pydantic v2
53+
.PHONY: ci-v2 ## Run all CI validation steps without making any changes to code in pydantic v2
5554
ci-v2: install-v2 lint mypy test
5655

5756

@@ -108,7 +107,7 @@ docs-build:
108107

109108
.PHONY: docs-format ## Format the python code that is part of the docs
110109
docs-format:
111-
ruff $(docs_src)
110+
ruff check $(docs_src)
112111
autoflake -r --remove-all-unused-imports --ignore-init-module-imports $(docs_src) -i
113112
black -l 82 $(docs_src)
114113

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
</p>
44
<p align="center">
55
<a href="https://github.com/dmontagu/fastapi-utils" target="_blank">
6-
<img src="https://img.shields.io/github/last-commit/dmontagu/fastapi-utils.svg">
7-
<img src="https://github.com/dmontagu/fastapi-utils/workflows/build/badge.svg" alt="Build CI">
6+
<img src="https://img.shields.io/github/last-commit/dmontagu/fastapi-utils.svg">
7+
<img src="https://github.com/dmontagu/fastapi-utils/workflows/build/badge.svg" alt="Build CI">
88
</a>
99
<a href="https://codecov.io/gh/dmontagu/fastapi-utils" target="_blank">
1010
<img src="https://codecov.io/gh/dmontagu/fastapi-utils/branch/master/graph/badge.svg" alt="Coverage">
@@ -20,13 +20,13 @@
2020
</p>
2121

2222
---
23-
**Documentation**: <a href="https://fastapi-utils.davidmontague.xyz" target="_blank">https://fastapi-utils.davidmontague.xyz</a>
23+
**Documentation**: <a href="https://fastapiutils.github.io/fastapi-utils/" target="_blank">https://fastapiutils.github.io/fastapi-utils/</a>
2424

2525
**Source Code**: <a href="https://github.com/dmontagu/fastapi-utils" target="_blank">https://github.com/dmontagu/fastapi-utils</a>
2626

2727
---
2828

29-
<a href="https://fastapi.tiangolo.com">FastAPI</a> is a modern, fast web framework for building APIs with Python 3.7+.
29+
<a href="https://fastapi.tiangolo.com">FastAPI</a> is a modern, fast web framework for building APIs with Python 3.8+.
3030

3131
But if you're here, you probably already knew that!
3232

@@ -53,11 +53,11 @@ It also adds a variety of more basic utilities that are useful across a wide var
5353
* **CamelCase Conversions**: Convenience functions for converting strings from `snake_case` to `camelCase` or `PascalCase` and back
5454
* **GUID Type**: The provided GUID type makes it easy to use UUIDs as the primary keys for your database tables
5555

56-
See the [docs](https://fastapi-utils.davidmontague.xyz/) for more details and examples.
56+
See the [docs](https://fastapiutils.github.io/fastapi-utils//) for more details and examples.
5757

5858
## Requirements
5959

60-
This package is intended for use with any recent version of FastAPI (depending on `pydantic>=1.0`), and Python 3.7+.
60+
This package is intended for use with any recent version of FastAPI (depending on `pydantic>=1.0`), and Python 3.8+.
6161

6262
## Installation
6363

docs/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
</p>
44
<p align="center">
55
<a href="https://github.com/dmontagu/fastapi-utils" target="_blank">
6-
<img src="https://img.shields.io/github/last-commit/dmontagu/fastapi-utils.svg">
7-
<img src="https://github.com/dmontagu/fastapi-utils/workflows/build/badge.svg" alt="Build CI">
6+
<img src="https://img.shields.io/github/last-commit/dmontagu/fastapi-utils.svg">
7+
<img src="https://github.com/dmontagu/fastapi-utils/workflows/build/badge.svg" alt="Build CI">
88
</a>
99
<a href="https://codecov.io/gh/dmontagu/fastapi-utils" target="_blank">
1010
<img src="https://codecov.io/gh/dmontagu/fastapi-utils/branch/master/graph/badge.svg" alt="Coverage">
@@ -20,13 +20,13 @@
2020
</p>
2121

2222
---
23-
**Documentation**: <a href="https://fastapi-utils.davidmontague.xyz" target="_blank">https://fastapi-utils.davidmontague.xyz</a>
23+
**Documentation**: <a href="https://fastapiutils.github.io/fastapi-utils/" target="_blank">https://fastapiutils.github.io/fastapi-utils/</a>
2424

2525
**Source Code**: <a href="https://github.com/dmontagu/fastapi-utils" target="_blank">https://github.com/dmontagu/fastapi-utils</a>
2626

2727
---
2828

29-
<a href="https://fastapi.tiangolo.com">FastAPI</a> is a modern, fast web framework for building APIs with Python 3.7+.
29+
<a href="https://fastapi.tiangolo.com">FastAPI</a> is a modern, fast web framework for building APIs with Python 3.8+.
3030

3131
But if you're here, you probably already knew that!
3232

@@ -53,20 +53,20 @@ It also adds a variety of more basic utilities that are useful across a wide var
5353
* **CamelCase Conversions**: Convenience functions for converting strings from `snake_case` to `camelCase` or `PascalCase` and back
5454
* **GUID Type**: The provided GUID type makes it easy to use UUIDs as the primary keys for your database tables
5555

56-
See the [docs](https://https://fastapi-utils.davidmontague.xyz/) for more details and examples.
56+
See the [docs](https://https://fastapiutils.github.io/fastapi-utils//) for more details and examples.
5757

5858
## Requirements
5959

60-
This package is intended for use with any recent version of FastAPI (depending on `pydantic>=1.0`), and Python 3.7+.
60+
This package is intended for use with any recent version of FastAPI (depending on `pydantic>=1.0`), and Python 3.8+.
6161

6262
## Installation
6363

6464
```bash
65-
pip install fastapi-restful # For basic slim package :)
65+
pip install fastapi-utils # For basic slim package :)
6666

67-
pip install fastapi-restful[session] # To add sqlalchemy session maker
67+
pip install fastapi-utils[session] # To add sqlalchemy session maker
6868

69-
pip install fastapi-restful[all] # For all the packages
69+
pip install fastapi-utils[all] # For all the packages
7070
```
7171

7272
## License

fastapi_utils/__init__.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
1-
import sys
1+
import importlib.metadata
22
import warnings
33

44
from .cbv_base import Api, Resource, set_responses, take_init_parameters
55

6-
if sys.version_info.minor < 8:
7-
import pkg_resources
8-
9-
try:
10-
__version__ = pkg_resources.get_distribution(__name__).version
11-
except pkg_resources.DistributionNotFound as e:
12-
warnings.warn(f"Could not determine version of {__name__}", stacklevel=1)
13-
warnings.warn(str(e), stacklevel=1)
14-
__version__ = "unknown"
15-
else:
16-
import importlib.metadata
17-
18-
try:
19-
__version__ = importlib.metadata.version(__name__)
20-
except importlib.metadata.PackageNotFoundError as e:
21-
warnings.warn(f"Could not determine version of {__name__}", stacklevel=1)
22-
warnings.warn(str(e), stacklevel=1)
23-
__version__ = "unknown"
6+
try:
7+
__version__ = "0.8.0"
8+
except importlib.metadata.PackageNotFoundError as e:
9+
warnings.warn(f"Could not determine version of {__name__}", stacklevel=1)
10+
warnings.warn(str(e), stacklevel=1)
11+
__version__ = "0.8.0"
2412

2513

2614
__all__ = [

0 commit comments

Comments
 (0)