Skip to content

Commit

Permalink
Fixed docker build for the local package , Upgraded image to use pyth…
Browse files Browse the repository at this point in the history
…on 3.11
  • Loading branch information
kshitijrajsharma committed Mar 7, 2024
1 parent 6a82098 commit 453e799
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.10
ARG PYTHON_VERSION=3.11

FROM docker.io/python:${PYTHON_VERSION}-slim-bookworm as base

Expand All @@ -17,13 +17,17 @@ RUN apt-get update \
build-essential libpq-dev libspatialite-dev libgdal-dev libboost-numpy-dev
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN gdal-config --version | awk -F'[.]' '{print $1"."$2}'

COPY setup.py .
COPY pyproject.toml .
COPY requirements.txt .
COPY README.md .
RUN pip install --user --no-cache-dir --upgrade pip \
COPY LICENSE .
RUN pip install --user --no-cache-dir --upgrade pip setuptools wheel\
&& pip install --user --no-cache-dir GDAL=="$(gdal-config --version)" \
&& pip install --user --no-cache-dir -r requirements.txt \
&& pip install --user --no-cache-dir -e .
&& pip install --user --no-cache-dir -r requirements.txt

RUN pip install --user -e .

FROM base as runner
WORKDIR /home/appuser
Expand All @@ -46,6 +50,7 @@ COPY README.md .
# COPY config.txt ./config.txt

COPY setup.py .
COPY pyproject.toml .
COPY API/ ./API/
COPY src/ ./src/
# Use a separate stage to pull the tippecanoe image
Expand Down
58 changes: 26 additions & 32 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,56 +1,45 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
requires = ["setuptools >= 61.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "raw-data-api"
version = "1.0.17"
description = "Set of high-performant APIs for transforming and exporting OpenStreetMap (OSM) data in different GIS file formats."
readme = "README.md"
authors = [{ name = "Hot Tech Team", email = "[email protected]" }]
authors = [
{ name = "Hot Tech Team", email = "[email protected]" }
]
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
]
keywords = [
"OSM", "rawdataapi",
]
dependencies = [
"pytest==7.4.3",
"psycopg2",
"boto3==1.24.38",
"fastapi==0.105.0",
"geojson==3.1.0",
"area==1.1.1",
"orjson==3.9.10",
"slowapi==0.1.8",
]
requires-python = ">=3.8"

[project.optional-dependencies]
build = ["build", "twine"]
dev = ["black", "bumpver", "isort"]
[project.optional-dependencies]
dev = ["black", "bumpver", "isort"]

[project.urls]
repository = "https://github.com/hotosm/fAIr-utilities"
[project.urls]
repository = "https://github.com/hotosm/raw-data-api"

[tool.bumpver]
current_version = "1.0.51"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
tag = true
push = false

[tool.bumpver.file_patterns]
"pyproject.toml" = [
'current_version = "{version}"',
'version = "{version}"',
]
current_version = "1.0.17"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
tag = true
push = false

[tool.bumpver.file_patterns]
"pyproject.toml" = [
'current_version = "{version}"',
'version = "{version}"',
]

[tool.isort]
profile = "black"
import_heading_stdlib = "Standard library imports"
profile = "black"
import_heading_stdlib = "Standard library imports"
import_heading_thirdparty = "Third party imports"
import_heading_firstparty = "Reader imports"

Expand All @@ -60,3 +49,8 @@ tag_format = "$version"
version_scheme = "semver"
version_provider = "pep621"
update_changelog_on_bump = true


[tool.setuptools]
packages = { find = { where = ["src","API"]} }

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Third party imports
from setuptools import setup

setup()

0 comments on commit 453e799

Please sign in to comment.