Skip to content

Commit 8169e86

Browse files
add python 3.12 support and some docker cleanup (#654)
* add python 3.12 support and some docker cleanup * 🤦
1 parent 53711ec commit 8169e86

File tree

9 files changed

+38
-58
lines changed

9 files changed

+38
-58
lines changed

.github/workflows/cicd.yaml

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,9 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: ["3.8", "3.9", "3.10", "3.11"]
13+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1414
timeout-minutes: 20
1515

16-
services:
17-
db_service:
18-
image: ghcr.io/stac-utils/pgstac:v0.7.1
19-
env:
20-
POSTGRES_USER: username
21-
POSTGRES_PASSWORD: password
22-
POSTGRES_DB: postgis
23-
POSTGRES_HOST: localhost
24-
POSTGRES_PORT: 5432
25-
PGUSER: username
26-
PGPASSWORD: password
27-
PGDATABASE: postgis
28-
ALLOW_IP_RANGE: 0.0.0.0/0
29-
# Set health checks to wait until postgres has started
30-
options: >-
31-
--health-cmd pg_isready
32-
--health-interval 10s
33-
--health-timeout 10s
34-
--health-retries 10
35-
--log-driver none
36-
ports:
37-
# Maps tcp port 5432 on service container to the host
38-
- 5432:5432
39-
4016
steps:
4117
- name: Check out repository code
4218
uses: actions/checkout@v4
@@ -55,18 +31,18 @@ jobs:
5531
5632
- name: Install types
5733
run: |
58-
pip install ./stac_fastapi/types[dev]
34+
python -m pip install ./stac_fastapi/types[dev]
5935
6036
- name: Install core api
6137
run: |
62-
pip install ./stac_fastapi/api[dev]
38+
python -m pip install ./stac_fastapi/api[dev]
6339
6440
- name: Install Extensions
6541
run: |
66-
pip install ./stac_fastapi/extensions[dev]
42+
python -m pip install ./stac_fastapi/extensions[dev]
6743
6844
- name: Test
69-
run: pytest -svvv
45+
run: python -m pytest -svvv
7046
env:
7147
ENVIRONMENT: testing
7248

@@ -93,14 +69,14 @@ jobs:
9369
run: |
9470
python -m pip install ./stac_fastapi/types[dev]
9571
96-
- name: Install extensions
97-
run: |
98-
python -m pip install ./stac_fastapi/extensions
99-
10072
- name: Install core api
10173
run: |
10274
python -m pip install ./stac_fastapi/api[dev,benchmark]
10375
76+
- name: Install extensions
77+
run: |
78+
python -m pip install ./stac_fastapi/extensions
79+
10480
- name: Run Benchmark
10581
run: python -m pytest stac_fastapi/api/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json
10682

.github/workflows/deploy_mkdocs.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
run: |
3030
python -m pip install --upgrade pip
3131
python -m pip install \
32-
stac_fastapi/api[docs] \
3332
stac_fastapi/types[docs] \
33+
stac_fastapi/api[docs] \
3434
stac_fastapi/extensions[docs] \
3535
3636
- name: update API docs
@@ -40,14 +40,6 @@ jobs:
4040
--exclude_source \
4141
--overwrite \
4242
stac_fastapi
43-
env:
44-
POSTGRES_USER: username
45-
POSTGRES_PASS: password
46-
POSTGRES_DBNAME: postgis
47-
POSTGRES_HOST: localhost
48-
POSTGRES_PORT: 5432
49-
POSTGRES_HOST_READER: localhost
50-
POSTGRES_HOST_WRITER: localhost
5143
5244
- name: Deploy docs
5345
run: mkdocs gh-deploy --force -f docs/mkdocs.yml

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ WORKDIR /app
1616

1717
COPY . /app
1818

19-
RUN pip install -e ./stac_fastapi/types[dev] && \
20-
pip install -e ./stac_fastapi/api[dev] && \
21-
pip install -e ./stac_fastapi/extensions[dev]
19+
RUN python -m pip install -e ./stac_fastapi/types[dev] && \
20+
python -m pip install -e ./stac_fastapi/api[dev] && \
21+
python -m pip install -e ./stac_fastapi/extensions[dev]

Dockerfile.docs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ COPY . /opt/src
1111
WORKDIR /opt/src
1212

1313
RUN python -m pip install \
14-
stac_fastapi/api \
1514
stac_fastapi/types \
15+
stac_fastapi/api \
1616
stac_fastapi/extensions
1717

1818
CMD ["pdocs", \
@@ -21,4 +21,4 @@ CMD ["pdocs", \
2121
"docs/api/", \
2222
"--exclude_source", \
2323
"--overwrite", \
24-
"stac_fastapi"]
24+
"stac_fastapi"]

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ image:
44

55
.PHONY: install
66
install:
7-
pip install wheel && \
8-
pip install -e ./stac_fastapi/api[dev] && \
9-
pip install -e ./stac_fastapi/types[dev] && \
10-
pip install -e ./stac_fastapi/extensions[dev]
7+
python -m pip install wheel && \
8+
python -m pip install -e ./stac_fastapi/types[dev] && \
9+
python -m pip install -e ./stac_fastapi/api[dev] && \
10+
python -m pip install -e ./stac_fastapi/extensions[dev]
1111

1212
.PHONY: docs-image
1313
docs-image:
@@ -21,4 +21,4 @@ docs: docs-image
2121

2222
.PHONY: test
2323
test: image
24-
pytest .
24+
python -m pytest .

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ Backends are hosted in their own repositories:
4545

4646
```bash
4747
# Install from PyPI
48-
pip install stac-fastapi.api stac-fastapi.types stac-fastapi.extensions
48+
python -m pip install stac-fastapi.types stac-fastapi.api stac-fastapi.extensions
4949

5050
# Install a backend of your choice
51-
pip install stac-fastapi.sqlalchemy
51+
python -m pip install stac-fastapi.sqlalchemy
5252
# or
53-
pip install stac-fastapi.pgstac
53+
python -m pip install stac-fastapi.pgstac
5454
```
5555

5656
Other backends may be available from other sources, search [PyPI](https://pypi.org/) for more.
@@ -60,14 +60,14 @@ Other backends may be available from other sources, search [PyPI](https://pypi.o
6060
Install the packages in editable mode:
6161

6262
```shell
63-
pip install -e \
64-
'stac_fastapi/api[dev]' \
63+
python -m pip install -e \
6564
'stac_fastapi/types[dev]' \
65+
'stac_fastapi/api[dev]' \
6666
'stac_fastapi/extensions[dev]'
6767
```
6868

6969
To run the tests:
7070

7171
```shell
72-
pytest
72+
python -m pytest
7373
```

stac_fastapi/api/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
"Intended Audience :: Information Technology",
4242
"Intended Audience :: Science/Research",
4343
"Programming Language :: Python :: 3.8",
44+
"Programming Language :: Python :: 3.9",
45+
"Programming Language :: Python :: 3.10",
46+
"Programming Language :: Python :: 3.11",
47+
"Programming Language :: Python :: 3.12",
4448
"License :: OSI Approved :: MIT License",
4549
],
4650
keywords="STAC FastAPI COG",

stac_fastapi/extensions/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
"Intended Audience :: Information Technology",
3737
"Intended Audience :: Science/Research",
3838
"Programming Language :: Python :: 3.8",
39+
"Programming Language :: Python :: 3.9",
40+
"Programming Language :: Python :: 3.10",
41+
"Programming Language :: Python :: 3.11",
42+
"Programming Language :: Python :: 3.12",
3943
"License :: OSI Approved :: MIT License",
4044
],
4145
keywords="STAC FastAPI COG",

stac_fastapi/types/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
"Intended Audience :: Information Technology",
3838
"Intended Audience :: Science/Research",
3939
"Programming Language :: Python :: 3.8",
40+
"Programming Language :: Python :: 3.9",
41+
"Programming Language :: Python :: 3.10",
42+
"Programming Language :: Python :: 3.11",
43+
"Programming Language :: Python :: 3.12",
4044
"License :: OSI Approved :: MIT License",
4145
],
4246
keywords="STAC FastAPI COG",

0 commit comments

Comments
 (0)