Skip to content

Commit

Permalink
Merge pull request #125 from wri/staging
Browse files Browse the repository at this point in the history
Merge Python 3.10 upgrade up to production
  • Loading branch information
dmannarino authored Sep 26, 2023
2 parents ebcb76a + beba7ce commit 6c8a614
Show file tree
Hide file tree
Showing 24 changed files with 1,795 additions and 1,221 deletions.
32 changes: 20 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,39 @@ repos:
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.7.0
rev: v5.10.1
hooks:
- id: isort
- repo: https://github.com/myint/docformatter
rev: v1.4
hooks:
- id: docformatter
args: [--in-place]
- repo: https://github.com/ambv/black
rev: 22.3.0
rev: 22.12.0
hooks:
- id: black
language_version: python3.8
language_version: python3.10
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.3.0
hooks:
- id: detect-aws-credentials
- id: detect-private-key
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.790
rev: v0.971
hooks:
- id: mypy
- id: mypy
language_version: python3.10
additional_dependencies: [types-cachetools]

- repo: https://github.com/Yelp/detect-secrets
rev: v0.14.3
rev: v1.3.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline'] # run: `pip install detect-secrets` to establish baseline
exclude: Pipfile.lock
- id: detect-secrets
args: ['--baseline', '.secrets.baseline'] # run: `pip install detect-secrets` to establish baseline
exclude: Pipfile.lock
60 changes: 44 additions & 16 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"custom_plugin_paths": [],
"exclude": {
"files": null,
"lines": null
},
"generated_at": "2021-01-22T04:28:05Z",
"plugins_used": [
{
Expand All @@ -13,8 +8,8 @@
"name": "ArtifactoryDetector"
},
{
"base64_limit": 4.5,
"name": "Base64HighEntropyString"
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
Expand All @@ -23,8 +18,8 @@
"name": "CloudantDetector"
},
{
"hex_limit": 3,
"name": "HexHighEntropyString"
"name": "HexHighEntropyString",
"limit": 3
},
{
"name": "IbmCloudIamDetector"
Expand Down Expand Up @@ -61,16 +56,49 @@
"results": {
"Pipfile.lock": [
{
"type": "Hex High Entropy String",
"filename": "Pipfile.lock",
"hashed_secret": "368fb7397ca8dacf5ebcfaf009a91cee7dc82208",
"is_verified": false,
"line_number": 4,
"type": "Hex High Entropy String"
"line_number": 4
}
]
},
"version": "0.14.3",
"word_list": {
"file": null,
"hash": null
}
"version": "1.3.0",
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
}
]
}
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10-slim

# Optional build argument for different environments
ARG ENV

RUN apt-get -y update && apt-get -y --no-install-recommends install \
make gcc libc-dev libgeos-dev musl-dev libpq-dev libffi-dev

RUN pip install --upgrade pip && pip install pipenv==2021.5.29
RUN pip install --upgrade pip && pip install pipenv==v2022.11.30
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock

RUN if [ "$ENV" = "dev" ] || [ "$ENV" = "test" ]; then \
echo "Install all dependencies" && \
apt-get install -y --no-install-recommends git postgresql-client lsb-release && \
pipenv install --system --deploy --ignore-pipfile --dev; \
apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common && \
curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor | tee /usr/share/keyrings/hashicorp-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list && \
apt update && apt install -y terraform; \
pipenv install --system --deploy --ignore-pipfile --dev && \
apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl gnupg-agent software-properties-common && \
curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list && \
apt-get update && apt-get install -y --no-install-recommends terraform=0.13.3; \
else \
echo "Install production dependencies only" && \
pipenv install --system --deploy; \
Expand Down
22 changes: 9 additions & 13 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@ name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[[source]]
name = "pypi-test"
url = "https://test.pypi.org/simple"
verify_ssl = true

[dev-packages]
black = "==21.9b0" # Pin to avoid having to allow pre-releases
black = "==22.12.0" # Pin to avoid having to allow pre-releases
detect-secrets = "*"
flake8 = "*"
pillow = "==8.3.1" # same as lambda layer
pillow = "==9.5.0" # same as lambda layer
pre-commit = "*"
pytest = "*"
pytest-asyncio = "*"
pytest-cov = "*"
python-dotenv = "*"
rasterio = "==1.2.10" # same as lambda layer
rasterio = "==1.3.8" # same as lambda layer

[packages]
aioboto3 = "*"
Expand All @@ -28,25 +23,26 @@ aenum = "<3.0"
async_lru = "*"
asyncpg = "*"
cachetools = "*"
fastapi = "<0.69"
fastapi = "<0.68"
geojson = "*"
gino = "*"
gino_starlette = "*"
httpx = "*"
httpx-auth = "*"
jinja2 = "*"
jinja2 = "<3.1"
mercantile = "==1.2.1" # same as lambda layer
orjson = "*"
pendulum = "*"
psycopg2 = "*"
pyproj = "*"
requests = "*"
SQLAlchemy = "*"
SQLAlchemy = "<1.4"
shapely = "*"
uvicorn = "*"
starlette = "<0.15"
uvicorn = {version = "*", extras = ["standard"]}

[requires]
python_version = "3.8"
python_version = "3.10"

[pipenv]
allow_prereleases = false
Loading

0 comments on commit 6c8a614

Please sign in to comment.