Skip to content

Commit

Permalink
Merge pull request #35 from JPchico/sqalchemy2.x
Browse files Browse the repository at this point in the history
Adding support for sqlalchemy 2.x
  • Loading branch information
Zlopez authored Jan 29, 2024
2 parents 868cfeb + 6073f3e commit f5b1a8f
Show file tree
Hide file tree
Showing 18 changed files with 1,096 additions and 572 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

name: CD

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

env:
FORCE_COLOR: 1

jobs:
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
matrix:
python: ["3.8"]
steps:
- uses: actions/[email protected]
- name: "Install dependencies"
run: sudo apt-get -y install graphviz
- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected]
with:
path: ~/.cache/pip
key: pip-${{ matrix.python }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys: pip-${{ matrix.python }}-tests-
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
- name: Make sure virtualevn>20 is installed, which will yield newer pip and possibility to pin pip version.
run: pip install virtualenv>20
- name: Install Tox
run: pip install tox
- name: Run pre-commit in Tox
run: tox -e pre-commit
test:
runs-on: "ubuntu-latest"
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/[email protected]
- name: "Install dependencies"
run: sudo apt-get -y install graphviz
- uses: actions/[email protected]
- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected]
with:
path: ~/.cache/pip
key: pip-${{ matrix.python }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys: pip-${{ matrix.python }}-tests-
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
- name: Make sure virtualevn>20 is installed, which will yield newer pip and possibility to pin pip version.
run: pip install virtualenv>20
- name: Install Tox
run: pip install tox
- name: "Test with tox"
run: |
tox -e py${{ matrix.python }} -- tests/ --cov=./sqlalchemy_schemadisplay --cov-append --cov-report=xml --cov-report=term-missing
release:
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags')"
runs-on: "ubuntu-latest"
needs: "test"
steps:
- uses: "actions/checkout@v3"

- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install build
- name: "Build"
run: |
python -m build
git status --ignored
- name: "Publish"
uses: "pypa/gh-action-pypi-publish@release/v1"
with:
user: "__token__"
password: "${{ secrets.TEST_PYPI_API_TOKEN }}"
repository_url: "https://test.pypi.org/legacy/"
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on: [push, pull_request]

env:
FORCE_COLOR: 1

jobs:
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
matrix:
python: ["3.8"]
steps:
- uses: actions/[email protected]
- name: "Install dependencies"
run: sudo apt-get -y install graphviz
- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected]
with:
path: ~/.cache/pip
key: pip-${{ matrix.python }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys: pip-${{ matrix.python }}-tests-
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
- name: Make sure virtualevn>20 is installed, which will yield newer pip and possibility to pin pip version.
run: pip install virtualenv>20
- name: Install Tox
run: pip install tox
- name: Run pre-commit in Tox
run: tox -e pre-commit
test:
runs-on: "ubuntu-latest"
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/[email protected]
- name: "Install dependencies"
run: sudo apt-get -y install graphviz
- uses: actions/[email protected]
- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected]
with:
path: ~/.cache/pip
key: pip-${{ matrix.python }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys: pip-${{ matrix.python }}-tests-
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
- name: Make sure virtualevn>20 is installed, which will yield newer pip and possibility to pin pip version.
run: pip install virtualenv>20
- name: Install Tox
run: pip install tox
- name: "Test with tox"
run: |
tox -e py${{ matrix.python }} -- tests/ --cov=./sqlalchemy_schemadisplay --cov-append --cov-report=xml --cov-report=term-missing
60 changes: 0 additions & 60 deletions .github/workflows/test-and-release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/.coverage
/dist/
/htmlcov/
.vscode/*
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Install pre-commit hooks via
# pre-commit install
exclude: >
(?x)^(tests/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PA
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
DEALINGS IN THE SOFTWARE.
98 changes: 98 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "sqlalchemy_schemadisplay"
dynamic = ["version", "description"]
authors = [{name = "Florian Schulze", email = "[email protected]"}]
readme = "README.rst"
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Database :: Front-Ends",
"Operating System :: OS Independent"
]
keywords = ["aiida", "workflows", "lammps"]
requires-python = ">=3.8"
dependencies = [
'setuptools',
'sqlalchemy>=2.0,<3',
'pydot',
'Pillow'
]

[project.urls]
Documentation = "https://github.com/fschulze/sqlalchemy_schemadisplay/blob/master/README.rst"
Source = "https://github.com/fschulze/sqlalchemy_schemadisplay"

[project.optional-dependencies]
testing = [
"attrs>=17.4.0",
"pgtest",
"pytest",
"pytest-cov",
"coverage",
"pytest-timeout",
"pytest-regressions"
]

pre-commit = [
"pre-commit",
"tox>=3.23.0",
"virtualenv>20"
]

[tool.flit.module]
name = "sqlalchemy_schemadisplay"

[tool.flit.sdist]
exclude = [
"docs/",
"tests/",
]

[tool.coverage.run]
# Configuration of [coverage.py](https://coverage.readthedocs.io)
# reporting which lines of your plugin are covered by tests
source=["sqlalchemy_schemadisplay"]

[tool.isort]
skip = ["venv"]
# Force imports to be sorted by module, independent of import type
force_sort_within_sections = true
# Group first party and local folder imports together
no_lines_before = ["LOCALFOLDER"]

# Configure isort to work without access to site-packages
known_first_party = ["sqlalchemy_schemadisplay"]

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = pre-commit,py{3.8,3.9,3.10}
requires = virtualenv >= 20
isolated_build = True
[testenv]
commands = pytest {posargs}
extras = testing
[testenv:pre-commit]
allowlist_externals = bash
commands = bash -ec 'pre-commit run --all-files || ( git diff; git status; exit 1; )'
extras =
pre-commit
tests
[flake8]
max-line-length = 140
import-order-style = edited
[pycodestyle]
max-line-length = 140
"""
33 changes: 0 additions & 33 deletions setup.py

This file was deleted.

Loading

0 comments on commit f5b1a8f

Please sign in to comment.