Skip to content

Commit ee157e0

Browse files
committed
fix: names and infrastructure
1 parent 5c576e9 commit ee157e0

19 files changed

+182
-444
lines changed

.github/dependabot.yml

+1-21
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,6 @@ updates:
99
schedule:
1010
interval: weekly
1111
- package-ecosystem: pip
12-
directory: "/stac_fastapi/api"
13-
schedule:
14-
interval: weekly
15-
- package-ecosystem: pip
16-
directory: "/stac_fastapi/api"
17-
schedule:
18-
interval: weekly
19-
- package-ecosystem: pip
20-
directory: "/stac_fastapi/types"
21-
schedule:
22-
interval: weekly
23-
- package-ecosystem: pip
24-
directory: "/stac_fastapi/extensions"
25-
schedule:
26-
interval: weekly
27-
- package-ecosystem: pip
28-
directory: "/stac_fastapi/pgstac"
29-
schedule:
30-
interval: weekly
31-
- package-ecosystem: pip
32-
directory: "/stac_fastapi/sqlalchemy"
12+
directory: "/"
3313
schedule:
3414
interval: weekly

.github/workflows/cicd.yaml

+8-58
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,13 @@ jobs:
5353
python -m pip install pre-commit
5454
pre-commit run --all-files
5555
56-
- name: Install pipenv
56+
- name: Install
5757
run: |
58-
python -m pip install --upgrade pipenv wheel
59-
60-
- name: Install types
61-
run: |
62-
pip install ./stac_fastapi/types[dev]
63-
64-
- name: Install core api
65-
run: |
66-
pip install ./stac_fastapi/api[dev]
67-
68-
- name: Install Extensions
69-
run: |
70-
pip install ./stac_fastapi/extensions[dev]
71-
72-
- name: Install sqlalchemy stac-fastapi
73-
run: |
74-
pip install ./stac_fastapi/sqlalchemy[dev,server]
75-
76-
- name: Install pgstac stac-fastapi
77-
run: |
78-
pip install ./stac_fastapi/pgstac[dev,server]
58+
pip install .[dev,server]
7959
8060
- name: Run migration
8161
run: |
82-
cd stac_fastapi/sqlalchemy && alembic upgrade head
62+
alembic upgrade head
8363
env:
8464
POSTGRES_USER: username
8565
POSTGRES_PASS: password
@@ -88,32 +68,7 @@ jobs:
8868
POSTGRES_PORT: 5432
8969

9070
- name: Run test suite
91-
run: |
92-
cd stac_fastapi/api && pipenv run pytest -svvv
93-
env:
94-
ENVIRONMENT: testing
95-
96-
- name: Run test suite
97-
run: |
98-
cd stac_fastapi/types && pipenv run pytest -svvv
99-
env:
100-
ENVIRONMENT: testing
101-
102-
- name: Run test suite
103-
run: |
104-
cd stac_fastapi/sqlalchemy && pipenv run pytest -svvv
105-
env:
106-
ENVIRONMENT: testing
107-
POSTGRES_USER: username
108-
POSTGRES_PASS: password
109-
POSTGRES_DBNAME: postgis
110-
POSTGRES_HOST_READER: localhost
111-
POSTGRES_HOST_WRITER: localhost
112-
POSTGRES_PORT: 5432
113-
114-
- name: Run test suite
115-
run: |
116-
cd stac_fastapi/pgstac && pipenv run pytest -svvv
71+
run: make test
11772
env:
11873
ENVIRONMENT: testing
11974
POSTGRES_USER: username
@@ -125,10 +80,6 @@ jobs:
12580

12681
validate:
12782
runs-on: ubuntu-latest
128-
strategy:
129-
fail-fast: false
130-
matrix:
131-
backend: ["sqlalchemy", "pgstac"]
13283
services:
13384
pgstac:
13485
image: ghcr.io/stac-utils/pgstac:v0.7.1
@@ -155,20 +106,19 @@ jobs:
155106
with:
156107
python-version: "3.10"
157108
cache: pip
158-
cache-dependency-path: stac_fastapi/pgstac/setup.cfg
109+
cache-dependency-path: setup.py
159110
- name: Install stac-fastapi and stac-api-validator
160-
run: pip install ./stac_fastapi/api ./stac_fastapi/types ./stac_fastapi/${{ matrix.backend }}[server] stac-api-validator==0.4.1
111+
run: pip install .[server] stac-api-validator==0.4.1
161112
- name: Run migration
162-
if: ${{ matrix.backend == 'sqlalchemy' }}
163-
run: cd stac_fastapi/sqlalchemy && alembic upgrade head
113+
run: alembic upgrade head
164114
env:
165115
POSTGRES_USER: username
166116
POSTGRES_PASS: password
167117
POSTGRES_DBNAME: postgis
168118
POSTGRES_HOST: localhost
169119
POSTGRES_PORT: 5432
170120
- name: Load data and validate
171-
run: python -m stac_fastapi.${{ matrix.backend }}.app & ./scripts/wait-for-it.sh localhost:8080 && python ./scripts/ingest_joplin.py http://localhost:8080 && ./scripts/validate http://localhost:8080
121+
run: python -m stac_fastapi.sqlalchemy.app & ./scripts/wait-for-it.sh localhost:8080 && python ./scripts/ingest_joplin.py http://localhost:8080 && ./scripts/validate http://localhost:8080
172122
env:
173123
POSTGRES_USER: username
174124
POSTGRES_PASS: password

.github/workflows/deploy_mkdocs.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ jobs:
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip
31-
python -m pip install -e \
32-
stac_fastapi/api \
33-
stac_fastapi/types \
34-
stac_fastapi/extensions \
35-
stac_fastapi/sqlalchemy
31+
python -m pip install -e .
3632
python -m pip install mkdocs mkdocs-material pdocs
3733
3834
- name: update API docs
@@ -41,7 +37,7 @@ jobs:
4137
--output_dir docs/api/ \
4238
--exclude_source \
4339
--overwrite \
44-
stac_fastapi
40+
stac_fastapi.sqlalchemy
4541
env:
4642
POSTGRES_USER: username
4743
POSTGRES_PASS: password

.pre-commit-config.yaml

+53-56
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,54 @@
11
repos:
2-
- repo: https://github.com/PyCQA/isort
3-
rev: 5.12.0
4-
hooks:
5-
- id: isort
6-
language_version: python3.8
7-
-
8-
repo: https://github.com/psf/black
9-
rev: 22.12.0
10-
hooks:
11-
- id: black
12-
args: ['--safe']
13-
language_version: python3.8
14-
-
15-
repo: https://github.com/pycqa/flake8
16-
rev: 6.0.0
17-
hooks:
18-
- id: flake8
19-
language_version: python3.8
20-
args: [
21-
# E501 let black handle all line length decisions
22-
# W503 black conflicts with "line break before operator" rule
23-
# E203 black conflicts with "whitespace before ':'" rule
24-
'--ignore=E501,W503,E203,C901']
25-
-
26-
repo: https://github.com/chewse/pre-commit-mirrors-pydocstyle
27-
# 2.1.1
28-
rev: v2.1.1
29-
hooks:
30-
- id: pydocstyle
31-
language_version: python3.8
32-
exclude: '.*(test|alembic|scripts).*'
33-
args: [
34-
# Check for docstring presence only
35-
'--select=D1',
36-
37-
]
38-
# Don't require docstrings for tests
39-
# '--match=(?!test).*\.py']
40-
# -
41-
# repo: https://github.com/pre-commit/mirrors-mypy
42-
# rev: v0.770
43-
# hooks:
44-
# - id: mypy
45-
# language_version: python3.8
46-
# args: [--no-strict-optional, --ignore-missing-imports]
47-
-
48-
repo: https://github.com/PyCQA/pydocstyle
49-
rev: 6.3.0
50-
hooks:
51-
- id: pydocstyle
52-
language_version: python3.8
53-
exclude: '.*(test|alembic|scripts).*'
54-
#args: [
55-
# Don't require docstrings for tests
56-
#'--match=(?!test|alembic|scripts).*\.py',
57-
#]
2+
- repo: https://github.com/PyCQA/isort
3+
rev: 5.12.0
4+
hooks:
5+
- id: isort
6+
language_version: python3.8
7+
- repo: https://github.com/psf/black
8+
rev: 22.12.0
9+
hooks:
10+
- id: black
11+
args: ["--safe"]
12+
language_version: python3.8
13+
- repo: https://github.com/pycqa/flake8
14+
rev: 6.0.0
15+
hooks:
16+
- id: flake8
17+
language_version: python3.8
18+
args: [
19+
# E501 let black handle all line length decisions
20+
# W503 black conflicts with "line break before operator" rule
21+
# E203 black conflicts with "whitespace before ':'" rule
22+
"--ignore=E501,W503,E203,C901",
23+
]
24+
- repo: https://github.com/chewse/pre-commit-mirrors-pydocstyle
25+
# 2.1.1
26+
rev: v2.1.1
27+
hooks:
28+
- id: pydocstyle
29+
language_version: python3.8
30+
exclude: ".*(test|alembic|scripts).*"
31+
args:
32+
[
33+
# Check for docstring presence only
34+
"--select=D1",
35+
]
36+
# Don't require docstrings for tests
37+
# '--match=(?!test).*\.py']
38+
# -
39+
# repo: https://github.com/pre-commit/mirrors-mypy
40+
# rev: v0.770
41+
# hooks:
42+
# - id: mypy
43+
# language_version: python3.8
44+
# args: [--no-strict-optional, --ignore-missing-imports]
45+
- repo: https://github.com/PyCQA/pydocstyle
46+
rev: 6.3.0
47+
hooks:
48+
- id: pydocstyle
49+
language_version: python3.8
50+
exclude: ".*(test|alembic|scripts).*"
51+
#args: [
52+
# Don't require docstrings for tests
53+
#'--match=(?!test|alembic|scripts).*\.py',
54+
#]

CONTRIBUTING.md

+14-16
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,45 @@
22

33
Issues and pull requests are more than welcome.
44

5-
**dev install**
5+
## Development install
66

7-
```bash
8-
$ git clone https://github.com/stac-utils/stac-fastapi.git
9-
$ cd stac-fastapi
10-
$ pip install -e stac_fastapi/api[dev]
7+
```shell
8+
git clone https://github.com/stac-utils/stac-fastapi-sqlalchemy
9+
cd stac-fastapi-sqlalchemy
10+
make install
1111
```
1212

13-
**Python3.8 only**
14-
1513
This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
1614

1715
```bash
18-
$ pre-commit install
16+
pre-commit install
1917
```
2018

2119
### Docs
2220

2321
```bash
24-
$ git clone https://github.com/stac-utils/stac-fastapi.git
25-
$ cd stac-fastapi
26-
$ pip install -e stac_fastapi/api["docs"]
22+
git clone https://github.com/stac-utils/stac-fastapi-sqlalchemy
23+
cd stac-fastapi-sqlalchemy
24+
pip install -e .[docs]
2725
```
2826

2927
Hot-reloading docs:
3028

3129
```bash
32-
$ mkdocs serve
30+
mkdocs serve
3331
```
3432

3533
To manually deploy docs (note you should never need to do this because GitHub
3634
Actions deploys automatically for new commits.):
3735

3836
```bash
39-
Create API documentations
40-
$ pdocs as_markdown \
37+
# Create API documentations
38+
pdocs as_markdown \
4139
--output_dir docs/api/ \
4240
--exclude_source \
4341
--overwrite \
44-
stac_fastapi
42+
stac_fastapi.sqlalchemy
4543

4644
# deploy
47-
$ mkdocs gh-deploy
45+
mkdocs gh-deploy
4846
```

Dockerfile

+1-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,4 @@ 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] && \
22-
pip install -e ./stac_fastapi/sqlalchemy[dev,server] && \
23-
pip install -e ./stac_fastapi/pgstac[dev,server]
19+
RUN pip install -e .[dev,server]

Dockerfile.docs

+7-11
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ COPY . /opt/src
1010

1111
WORKDIR /opt/src
1212

13-
RUN python -m pip install \
14-
stac_fastapi/api \
15-
stac_fastapi/types \
16-
stac_fastapi/extensions \
17-
stac_fastapi/sqlalchemy
13+
RUN python -m pip install .
1814

1915
CMD ["pdocs", \
20-
"as_markdown", \
21-
"--output_dir", \
22-
"docs/api/", \
23-
"--exclude_source", \
24-
"--overwrite", \
25-
"stac_fastapi"]
16+
"as_markdown", \
17+
"--output_dir", \
18+
"docs/api/", \
19+
"--exclude_source", \
20+
"--overwrite", \
21+
"stac_fastapi.sqlalchemy"]

0 commit comments

Comments
 (0)