Skip to content

Commit

Permalink
Merge pull request #40 from reecetech/feature/upd-pyproject-for-compl…
Browse files Browse the repository at this point in the history
…iance-and-upd-docker-tests

update pyproject for compliance and update docker unit tests to use R…
  • Loading branch information
fransy26 authored Nov 29, 2023
2 parents b5ded67 + ede3935 commit bc9f1a9
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 49 deletions.
66 changes: 34 additions & 32 deletions Dockerfile.testing
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,36 @@ FROM python:3.10 AS py310
RUN echo "${PYTHON_VERSION}" > /tmp/py310-latest

##------------------------------------------------------------------------------
FROM centos:7 AS base

# EPEL needed for openssl 1.1.x
RUN yum clean all \
&& yum update -y \
&& yum install -y \
epel-release \
nmap-ncat \
unixODBC \
&& yum clean all \
&& rm -rf /var/yum/cache
FROM rockylinux:9 AS base

RUN dnf makecache \
&& dnf update -y \
&& dnf install -y --allowerasing \
curl \
dnf-plugins-core \
&& dnf config-manager --set-enabled crb \
&& dnf install -y \
bzip2-devel \
findutils \
gcc \
gcc-c++ \
git \
libffi-devel \
make \
openssl-devel \
python-devel \
python3-pip \
wget \
xz \
zlib-devel \
sqlite-devel \
unixODBC-devel \
nc \
&& dnf clean all

##------------------------------------------------------------------------------
FROM base AS builder-base

RUN yum install -y \
make \
yum-utils

RUN yum-builddep -y python3

# For pyodbc
RUN yum install -y \
unixODBC-devel

# Python >= 3.10 needs openssl 1.1.x
RUN yum install -y \
openssl11-devel

RUN mkdir /usr/local/openssl11 \
&& cd /usr/local/openssl11 \
Expand All @@ -77,8 +79,8 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \

RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
&& cd "/tmp/Python-${PYTHON_VERSION}" \
&& ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
&& make install
&& ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
&& make -j 4 altinstall

USER root
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
Expand Down Expand Up @@ -110,8 +112,8 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \

RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
&& cd "/tmp/Python-${PYTHON_VERSION}" \
&& ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
&& make install
&& ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
&& make -j 4 altinstall

USER root
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
Expand Down Expand Up @@ -143,8 +145,8 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \

RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
&& cd "/tmp/Python-${PYTHON_VERSION}" \
&& ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
&& make install
&& ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
&& make -j 4 altinstall

USER root
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
Expand Down Expand Up @@ -176,8 +178,8 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \

RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
&& cd "/tmp/Python-${PYTHON_VERSION}" \
&& ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
&& make install
&& ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
&& make -j 4 altinstall

USER root
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ Requirements: Docker 19.03.2 or newer and Docker Compose 1.24.1 or newer.
Release History
---------------

Version 1.11.4

- Update pyproject.toml / setup.cfg and update docker tests to use Rocky9 instead of Centos7

Version 1.11.3

- Switch from setup.py to pyproject.toml / setup.cfg
Expand Down
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ classifiers=[

dynamic = ["version", "readme"]

dependencies = [
"django >= 3.2.0, < 5",
"pyodbc >= 4.0.0, < 5"
]

[optional-dependencies]
dev = ['check-manifest']
all =['%(test)s']
test = ['coverage']

[[project.authors]]
name = "Reecetech"
email = "[email protected]"
Expand All @@ -41,3 +51,6 @@ text = "APLv2"
[tool.setuptools.dynamic]
version = {attr = "django_informixdb.VERSION"}
readme = {file = "README.rst"}

[tool.distutils.bdist_wheel]
universal = true
17 changes: 0 additions & 17 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
[options]
packages = find:
install_requires =
django >= 3.2.0, < 5
pyodbc ~= 4.0.21

[options.extras_require]
dev =
check-manifest
test =
coverage
all =
%(test)s

[bdist_wheel]
universal=1

[aliases]
test=pytest

Expand Down
1 change: 1 addition & 0 deletions test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def db_config():
"OPTIONS": {},
"AUTOCOMMIT": True,
"CONN_MAX_AGE": None,
"CONN_HEALTH_CHECKS": False,
"TIME_ZONE": None,
}

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ deps =
pytest-django
pytest-mock
freezegun
pyodbc<5

dj3: Django>=3.2.0,<4
dj4: Django>=4,<5
Expand Down

0 comments on commit bc9f1a9

Please sign in to comment.