Skip to content

Commit 2adcb93

Browse files
committed
fix: lots of names and infrastructure
1 parent a907547 commit 2adcb93

20 files changed

+183
-462
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 21 deletions
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

Lines changed: 6 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -53,67 +53,12 @@ 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]
79-
80-
- name: Run migration
81-
run: |
82-
cd stac_fastapi/sqlalchemy && alembic upgrade head
83-
env:
84-
POSTGRES_USER: username
85-
POSTGRES_PASS: password
86-
POSTGRES_DBNAME: postgis
87-
POSTGRES_HOST: localhost
88-
POSTGRES_PORT: 5432
89-
90-
- 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
58+
pip install .[dev,server]
11359
11460
- name: Run test suite
115-
run: |
116-
cd stac_fastapi/pgstac && pipenv run pytest -svvv
61+
run: make test
11762
env:
11863
ENVIRONMENT: testing
11964
POSTGRES_USER: username
@@ -125,10 +70,6 @@ jobs:
12570

12671
validate:
12772
runs-on: ubuntu-latest
128-
strategy:
129-
fail-fast: false
130-
matrix:
131-
backend: ["sqlalchemy", "pgstac"]
13273
services:
13374
pgstac:
13475
image: ghcr.io/stac-utils/pgstac:v0.7.1
@@ -155,20 +96,11 @@ jobs:
15596
with:
15697
python-version: "3.10"
15798
cache: pip
158-
cache-dependency-path: stac_fastapi/pgstac/setup.cfg
99+
cache-dependency-path: setup.cfg
159100
- 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
161-
- name: Run migration
162-
if: ${{ matrix.backend == 'sqlalchemy' }}
163-
run: cd stac_fastapi/sqlalchemy && alembic upgrade head
164-
env:
165-
POSTGRES_USER: username
166-
POSTGRES_PASS: password
167-
POSTGRES_DBNAME: postgis
168-
POSTGRES_HOST: localhost
169-
POSTGRES_PORT: 5432
101+
run: pip install .[server] stac-api-validator==0.4.1
170102
- 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
103+
run: python -m stac_fastapi.pgstac.app & ./scripts/wait-for-it.sh localhost:8080 && python ./scripts/ingest_joplin.py http://localhost:8080 && ./scripts/validate http://localhost:8080
172104
env:
173105
POSTGRES_USER: username
174106
POSTGRES_PASS: password

.github/workflows/deploy_mkdocs.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,16 @@ 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
38-
- name: update API docs
34+
- name: Update API docs
3935
run: |
4036
pdocs as_markdown \
4137
--output_dir docs/api/ \
4238
--exclude_source \
4339
--overwrite \
44-
stac_fastapi
40+
stac_fastapi.pgstac
4541
env:
4642
POSTGRES_USER: username
4743
POSTGRES_PASS: password

.pre-commit-config.yaml

Lines changed: 53 additions & 56 deletions
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|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|scripts).*"
51+
#args: [
52+
# Don't require docstrings for tests
53+
#'--match=(?!test|scripts).*\.py',
54+
#]

CONTRIBUTING.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,40 @@
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-pgstac
9+
cd stac-fastapi-pgstac
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

17-
```bash
18-
$ pre-commit install
15+
```shell
16+
pre-commit install
1917
```
2018

21-
### Docs
19+
## 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-pgstac
23+
cd stac-fastapi-pgstac
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

38-
```bash
39-
Create API documentations
40-
$ pdocs as_markdown \
41-
--output_dir docs/api/ \
42-
--exclude_source \
43-
--overwrite \
44-
stac_fastapi
45-
36+
```shell
37+
# Create API documentations
38+
make docs
4639
# deploy
47-
$ mkdocs gh-deploy
40+
mkdocs gh-deploy
4841
```

Dockerfile

Lines changed: 1 addition & 5 deletions
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

Lines changed: 7 additions & 11 deletions
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.pgstac"]

0 commit comments

Comments
 (0)