Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for v3.0.0 release #65

Merged
merged 6 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Build

on:
pull_request:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Start database servers
run: |
docker-compose up -d
sleep 15s
sleep 5s
- name: Run integration tests
run: |
cp .env.example .env.test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
target: main
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
Expand Down
25 changes: 5 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# STAGE: base
# STAGE: main
# -----------
# The main image that is published.
FROM python:3.11-slim-bookworm AS base
FROM python:3.11-slim-bookworm AS main

ARG TARGETPLATFORM

Expand Down Expand Up @@ -36,29 +36,14 @@ RUN \
apt-get remove -y curl apt-transport-https debconf-utils g++ gcc rsync unixodbc-dev build-essential gnupg2 && \
apt-get autoremove -y && apt-get autoclean -y

# STAGE: dev
# ----------
# Intermediate image used to install dependencies.
FROM base AS dev

COPY requirements-dev.txt .
RUN pip install -r requirements-dev.txt

# STAGE: test
# -----------
# Image used for running tests.
FROM dev AS test
FROM main AS test

COPY requirements-dev.txt .
RUN pip install -r requirements-dev.txt
WORKDIR /test
COPY test ./test

CMD pylint -v -E **/*.py && pytest -v

# STAGE: lint-examples
# --------------------
# Image used to lint examples.
FROM dev AS lint-examples

COPY examples ./examples
RUN for f in examples/*/requirements.txt; do pip install -r "$f"; done
CMD pylint -v -E examples/**/*.py
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Travis](https://img.shields.io/travis/com/laudio/pyodbc.svg?style=flat-square&branch=master)](https://travis-ci.com/laudio/pyodbc)
[![Build](https://github.com/laudio/pyodbc/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/laudio/pyodbc/actions/workflows/ci.yml)
[![LICENSE](https://img.shields.io/github/license/laudio/pyodbc.svg?style=flat-square)](https://github.com/laudio/pyodbc/blob/master/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/laudio/pyodbc)

Expand All @@ -8,31 +8,31 @@ Docker image with python 3.11 and [pyodbc](https://github.com/mkleehammer/pyodbc

## Usage

#### Pull the image
### Pull the image

```bash
$ docker pull laudio/pyodbc
```

#### Using as a base image
### Usage as a base image

Usually this is expected to be used as a base image for your python app or scripts that requires pyodbc; in such such your `Dockerfile` might look something like this:
Use `laudio/pyodbc` as a base image for your python script.

```Dockerfile
FROM laudio/pyodbc:2.1.0
FROM laudio/pyodbc:3.0.0

WORKDIR /source
WORKDIR /app

# Add your source files.
COPY ["app", "./app"]
COPY ["src", "./src"]
COPY ["setup.py", "./"]

RUN pip install .

CMD ["python", "app/main.py"]
CMD ["python", "src/main.py"]
```

## Development
## Development (Contributing)

```bash
# 1. Clone this repository.
Expand Down Expand Up @@ -64,15 +64,15 @@ $ make clean build test

## Examples

#### Basic Connections
### Basic Connections

Examples showing a basic use case.

1. [MSSQL Example](examples/app-mssql)
2. [PostgreSQL Example](examples/app-pg)
3. [MySQL Example](examples/app-mysql)

#### Data Pipelines
### Data Pipelines

Examples illustrating data pipelines using pyodbc.

Expand Down