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

feat(CI): add python 3.12 to CI testing on github actions #659

Merged
merged 8 commits into from
Mar 14, 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
2 changes: 1 addition & 1 deletion .github/workflows/test-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "windows-latest", "macos-latest" ]
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
include:
- python: '2.7'
os: "ubuntu-latest"
Expand Down
19 changes: 12 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,25 @@ MANIFEST
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
# Unit test
.tox/
.nox/
.coverage
.coverage.*
.cache
.hypothesis/
.pytest_cache/
nosetests.xml
coverage.xml

# Coverage reports
.coverage
.coverage.*
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
lcov.info
cov.xml
coverage.xml
cover/
coverage/
htmlcov/

# Translations
*.mo
Expand Down
9 changes: 7 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
//
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.debugpy",
"charliermarsh.ruff",
"njpwerner.autodocstring",
"njqdev.vscode-python-typehint",
//
// "ms-python.pylint",
// "ms-python.flake8",
// "ms-python.mypy-type-checker",
// "ms-python.isort",
//
//-- Used for: Git, Code Quality -----------------------------------------------
//
"vivaxy.vscode-conventional-commits",
"codezombiech.gitignore"
"Wequick.coverage-gutters",
"vivaxy.vscode-conventional-commits"
]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
//-- Editor settings for all files -------------------------------------------------
//
"editor.formatOnSave": false, // Using this for reducing git changes between commits
"editor.formatOnPaste": true,
"editor.formatOnPaste": false,
"editor.formatOnType": true,
"editor.tabSize": 4,
"editor.wordWrapColumn": 83,
"editor.renderWhitespace": "boundary",
Expand Down
95 changes: 95 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/usr/bin/env -S bash -x -c 'docker compose --file docker-compose.yml up --detach'

#region commands -----------------------------------------------------------------------------------

#$ docker compose --file docker-compose.yml up --detach
#$ docker compose --file docker-compose.yml down --remove-orphans -v --rmi local

#$ docker exec --tty --interactive --privileged petl-xxxxxx /bin/bash

#$ docker exec -it petl-postgres psql -U petl --dbname=petl
#$ docker exec -it petl-msyql mysql --user=petl --database=petl --password=test

#endregion -----------------------------------------------------------------------------------------

#region docker composer ----------------------------------------------------------------------------

---
services:
postgres:
container_name: petl-postgres
hostname: petl_postgres
image: postgres:latest
environment:
- POSTGRES_USER=petl
- POSTGRES_PASSWORD=test
- POSTGRES_DB=petl
- POSTGRES_HOST_AUTH_METHOD=password
ports:
- "5432:5432/tcp"
restart: "unless-stopped"
stdin_open: true
tty: true
healthcheck:
test: ["CMD", "psql", "--host=localhost", "--username=petl", "--dbname=petl", "-c", "select 1 as ok"]
interval: 20s
timeout: 10s
retries: 5
start_period: 2s

mysql:
container_name: petl-mysql
hostname: petl_mysql
image: mysql:latest
ports:
- "3306:3306/tcp"
- "33060:33060/tcp"
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: "petl"
MYSQL_USER: "petl"
MYSQL_PASSWORD: "test"
MYSQL_ROOT_PASSWORD: "pass0"
restart: "unless-stopped"
stdin_open: true
tty: true
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 20s
timeout: 10s
retries: 5
start_period: 2s

samba:
container_name: petl-samba
hostname: petl_samba
image: dperson/samba
ports:
- "137:137/udp"
- "138:138/udp"
- "139:139/tcp"
- "445:445/tcp"
tmpfs:
- /tmp
restart: unless-stopped
stdin_open: true
tty: true
volumes:
- /mnt:/mnt:z
- /mnt2:/mnt2:z
command: '-s "public;/mnt;yes;no;yes;all" -s "mount2;/mnt2" -u "petl;test" -p'

sftp:
container_name: petl-sftp
hostname: petl_sftp
image: atmoz/sftp
ports:
- "22:22/tcp"
tmpfs:
- /tmp
restart: unless-stopped
stdin_open: true
tty: true
command: 'petl:test:::public'

#endregion -----------------------------------------------------------------------------------------
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from __future__ import print_function, absolute_import, division
from setuptools import setup, find_packages
from __future__ import absolute_import, division, print_function
Dismissed Show dismissed Hide dismissed
Dismissed Show dismissed Hide dismissed
Dismissed Show dismissed Hide dismissed

from setuptools import find_packages, setup

setup(
name='petl',
author='Alistair Miles',
author_email='[email protected]',
maintainer="Juarez Rudsatz",
maintainer_email="[email protected]",
package_dir={'': '.'},
packages=find_packages('.'),
scripts=['bin/petl'],
Expand Down Expand Up @@ -49,6 +51,7 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
51 changes: 37 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
# and then run "tox" from this directory.

[tox]
envlist = py27, py36, py37, py38, py39, py310, py311, {py36,py37,py38,py39,py310,py311}-docs
envlist = py27, py36, py37, py38, py39, py310, py311, {py36,py37,py38,py39,py310,py311,py312}-docs

[testenv]
# get stable output for unordered types
setenv =
PYTHONHASHSEED = 42
py27: PY_MAJOR_VERSION = py2
py36,py37,py38,py39,py310,py311: PY_MAJOR_VERSION = py3
py36,py37,py38,py39,py310,py311,py312: PY_MAJOR_VERSION = py3
commands =
pytest --cov=petl petl
pytest --cov=petl --cov-report lcov:lcov.info petl
coverage report -m
deps =
-rrequirements-tests.txt
-rrequirements-formats.txt

[testenv:{py36,py37,py38,py39,py310,py311}-docs]
[testenv:{py36,py37,py38,py39,py310,py311,py312}-docs]
# build documentation under similar environment to readthedocs
changedir = docs
deps =
-rrequirements-docs.txt
commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[testenv:{py36,py37,py38,py39,py310,py311}-doctest]
[testenv:{py36,py37,py38,py39,py310,py311,py312}-doctest]
commands =
py36,py37,py38,py39,py310,py311: pytest --doctest-modules --cov=petl petl
py36,py37,py38,py39,py310,py311,py312: pytest --doctest-modules --cov=petl --cov-report lcov:lcov.info petl
[testenv:{py36,py37,py38,py39}-dochtml]
changedir = docs
deps =
Expand All @@ -38,31 +38,54 @@ commands =
sphinx-build -W -b singlehtml -d {envtmpdir}/doctrees . _build/singlehtml

[testenv:remote]
# Create test containers with the following commands:
# docker run -it --name samba -p 139:139 -p 445:445 -d "dperson/samba" -p -u "petl;test" -s "public;/public-dir;yes;no;yes;all"
# docker run -it --name sftp -p 22:22 -d atmoz/sftp petl:test:::public
#? Create individual containers with the following commands:
#$ docker run -it --name samba -p 139:139 -p 445:445 -d "dperson/samba" -p -u "petl;test" -s "public;/public-dir;yes;no;yes;all"
#$ docker run -it --name sftp -p 22:22 -d atmoz/sftp petl:test:::public
#? Or create both with:
#$ docker compose up --detach samba sftp
#? Stop and remove the containers with:
#$ docker compose down --remove-orphans -v --rmi local
setenv =
{[testenv]setenv}
PETL_TEST_SMB=smb://WORKGROUP;petl:test@localhost/public/
PETL_TEST_SFTP=sftp://petl:test@localhost/public/
commands =
pytest --cov=petl petl
pytest --cov=petl --cov-report lcov:lcov.info petl
deps =
{[testenv]deps}
-rrequirements-remote.txt

[testenv:database]
# Create test containers with the following commands:
# docker run -it --name mysql -p 3306:3306 -p 33060:33060 -e MYSQL_ROOT_PASSWORD=pass0 -e MYSQL_DATABASE=petl -e MYSQL_USER=petl -e MYSQL_PASSWORD=test -d mysql:latest
# docker run -it --name postgres -p 5432:5432 -e POSTGRES_DB=petl -e POSTGRES_USER=petl -e POSTGRES_PASSWORD=test -d postgres:latest
#? Create individual test containers with the following commands:
#$ docker run -it --name mysql -p 3306:3306 -p 33060:33060 -e MYSQL_ROOT_PASSWORD=pass0 -e MYSQL_DATABASE=petl -e MYSQL_USER=petl -e MYSQL_PASSWORD=test -d mysql:latest
#$ docker run -it --name postgres -p 5432:5432 -e POSTGRES_DB=petl -e POSTGRES_USER=petl -e POSTGRES_PASSWORD=test -d postgres:latest
#? Or create both with:
#$ docker compose up --detach mysql postgres
setenv =
{[testenv]setenv}
commands =
pytest --cov=petl petl
pytest --cov=petl --cov-report lcov:lcov.info petl
deps =
-rrequirements-tests.txt
-rrequirements-database.txt

[testenv:compose]
#? Create test containers and run tests with the following commands:
#$ tox -e compose
setenv =
{[testenv:remote]setenv}
allowlist_externals =
docker
commands =
docker compose up --detach
pytest --cov=petl --cov-report lcov:lcov.info petl
coverage report -m
docker compose down --remove-orphans -v --rmi local
deps =
{[testenv]deps}
{[testenv:remote]deps}
{[testenv:database]deps}

[testenv:mysqldb]
basepython = python2.7
setenv =
Expand Down
Loading