Skip to content
Open
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
34 changes: 20 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.11", "3.12"]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -18,9 +18,9 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
mamba-version: "*"
Expand All @@ -29,13 +29,22 @@ jobs:
activate-environment: pyreaddbc
use-mamba: true
miniforge-variant: Mambaforge

- name: Install dependencies
run: |
# poetry config experimental.new-installer false
poetry config virtualenvs.create false
poetry build
poetry install

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Set up Python
run: uv python install

- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests
# For example, using `pytest`
run: uv run pytest tests

- name: Build wheel
run: uv build --wheel

- name: Lint with flake8
run: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This | character is needed so the CI can identify the next lines are related to the run command

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nasty syntax!

Expand All @@ -44,6 +53,3 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
run: |
poetry run pytest -vv -k "ZIKABR21 or STPI2206 or sids" tests/
1 change: 1 addition & 0 deletions conda/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dependencies:
- cffi
- gcc
- pip
- uv
- poetry
1,025 changes: 0 additions & 1,025 deletions poetry.lock

This file was deleted.

96 changes: 45 additions & 51 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,64 +1,58 @@
[build-system]
requires = [
"poetry-core>=1.0.0", "setuptools>=41.0.0", "wheel", "cffi"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.build]
script = "pyreaddbc/_build_readdbc.py"
generate-setup-file = false

[tool.poetry.group.dev.dependencies]
pandas = "^2.1.0"

[tool.poetry]
[project]
authors = [
{ name = "Flavio Codeco Coelho", email = "fccoelho@gmail.com" },
{ name = "Sandro Loch", email = "es.loch@gmail.com" },
]
license = { text = "AGPL-3.0" }
requires-python = "<4,>=3.9"
dependencies = [
"dbfread<3,>=2.0.7",
"tqdm<5,>=4.64.0",
"cffi<2,>=1.15.1",
"pyyaml>=6",
"setuptools>=75.6.0",
]
name = "pyreaddbc"
version = "1.1.0" # changed by semantic-release
Comment thread
fccoelho marked this conversation as resolved.
version = "1.1.0" # changed by semantic-release
description = "pyreaddbc package"
readme = "README.md"
authors = ["Flavio Codeco Coelho <fccoelho@gmail.com>", "Sandro Loch <es.loch@gmail.com>"]
license = "AGPL-3.0"
repository = "https://github.com/osl-incubator/pyreaddbc"
homepage = "https://github.com/osl-incubator/pyreaddbc"

# Pypi classifiers: https://pypi.org/classifiers/
classifiers = [ #! Update me
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

include = [
{path = "pyreaddbc/_readdbc.so"}
[tool.setuptools]
py-modules = ["pyreaddbc"]
ext-modules = [
{name = "pyreaddbc._readdbc", sources = ["pyreaddbc/_readdbc.c", "pyreaddbc/c-src/blast.c"], include-dirs = ["pyreaddbc", "pyreaddbc/c-src"]}#, libraries = ["readdbc"], library-dirs = ["pyreaddbc"]},
]

packages = [
{ include = "pyreaddbc" },
]

[tool.poetry.dependencies]
python = ">=3.9,<4"
dbfread = ">=2.0.7,<3"
tqdm = ">=4.64.0,<5"
cffi = ">=1.15.1,<2"
pyyaml = ">=6"
[build-system]
requires = ["setuptools>=61", "cffi"]
build-backend = "setuptools.build_meta"

[tool.poetry.dev-dependencies]
black = ">=22.6.0"
isort = ">=5.10.1"
flake8 = ">=5.0.4"
pre-commit = ">=2.20.0"
pytest = ">=7.1.2"
commitizen = ">=2.32.2"
chardet = ">=5.2.0"
[build]
default = ["python", "-m", "./pyreaddbc/_build_readdbc.py"]

[tool.black]
line-length = 79
skip-string-normalization = true
target-version = ["py39", "py310", "py311"]
target-version = ["py39", "py310", "py311", "py312"]
exclude = "docs/"

[project.optional-dependencies]
dev = [
"pytest<9.0.0,>=8.1.1",
"pandas<3.0.0,>=2.1.0",
]

[project.urls]
Repository = "https://github.com/AlertaDengue/pyreaddbc"

2 changes: 1 addition & 1 deletion pyreaddbc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""pyreaddbc Python package"""
from importlib import metadata as importlib_metadata

# import ._build_readdbc
from .readdbc import * # noqa F403


Expand Down
8 changes: 4 additions & 4 deletions pyreaddbc/_build_readdbc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
u"""
"""
Created on 16/08/16
by fccoelho
license: GPL V3 or Later
Expand All @@ -20,8 +20,8 @@
source=f.read(),
source_extension=".c",
libraries=["c"],
sources=[str(PACKAGE_REL_PATH / "c-src" / "blast.c")],
include_dirs=[str(PACKAGE_REL_PATH / "c-src")],
sources=[str(PACKAGE_ABS_PATH /"c-src"/ "blast.c")],
include_dirs=[str(PACKAGE_ABS_PATH / "c-src"), str(PACKAGE_ABS_PATH), str(PACKAGE_REL_PATH)],
)
ffibuilder.cdef(
"""
Expand All @@ -31,7 +31,7 @@
"""
)

with open(PACKAGE_ABS_PATH / "c-src" / "blast.h") as f:
with open(PACKAGE_ABS_PATH / "c-src" / "blast.h", "r") as f:
ffibuilder.cdef(f.read(), override=True)


Expand Down
4 changes: 4 additions & 0 deletions pyreaddbc/_readdbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,15 @@ static int search_in_struct_unions(const struct _cffi_type_context_s *ctx,
typedef unsigned char _Bool;
# endif
# endif
# define _cffi_float_complex_t _Fcomplex /* include <complex.h> for it */
# define _cffi_double_complex_t _Dcomplex /* include <complex.h> for it */
#else
# include <stdint.h>
# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
# include <alloca.h>
# endif
# define _cffi_float_complex_t float _Complex
# define _cffi_double_complex_t double _Complex
#endif

#ifdef __GNUC__
Expand Down