Skip to content

Commit

Permalink
fix: compat with pandas 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dmyersturnbull committed Jul 12, 2023
1 parent 0508f3f commit 13dc088
Show file tree
Hide file tree
Showing 80 changed files with 2,252 additions and 1,686 deletions.
45 changes: 35 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
# Check http://editorconfig.org for more information
# Useful: https://ukupat.github.io/tabs-or-spaces/
# Check https://editorconfig.org for more information
# These are derived from https://ukupat.github.io/tabs-or-spaces/
# The most majority indentation style was selected for each language
root = true

# In 2022, most languages are 2-space
# We assume TypeScript to be 2-space because JavaScript and JSX so strongly are,
# and we'd rather keep those two consistent.
[*]
end_of_line = lf
charset = utf-8
indent_size = 4
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space

[*.{yml,yaml,json,scala,coffee,css,js,sh,sql,tex,xml,html,htm,hs,ml,pp,R,rb}]
indent_size = 2
# 4-space, traditionally compiled without bytecode or JIT --
# Julia, Rust, D, C++, Objective-C, C, Fortran, and Assembly
# We exclude Fortran fixed-form (e.g. .f/.ftn); these have weird indentation rules
# C++ is even between 4-space and 2-space, while C is even between 4-space and tab
[*.{julia,rs,d,cpp,c,m,mm,f[0-9][0-9],inc,h,s,asm}]
indent_size = 4

[*.md]
indent_size = 2
trim_trailing_whitespace = false
# 4-space, generally VM --
# Erlang, F#, Python, PHP (in 8+), Java, Kotlin, Groovy (+Gradle), F#, erlang, Swift
[*.{py,php,java,groovy,gradle,kt,kts,cs,fs,fsx,fsi,erl,swift}]
indent_size = 4

# 4-space, generally interpreted --
# Lua, Vala, Perl, PowerShell, Batch
# Lua and Vala are about even between 4-space and tab
[*.{lua,vala,pl,perl,ps1,bat}]
indent_size = 4

[*.{go,lua,vala,v}]
# tab-based --
# Go, Haxe, Verilog, System Verilog, SAS, and AutoIt
[*.{go,hx,v,sv,sas,au3}]
indent_style = tab

# CSV-like
[*.{tsv,tab,csv}]
# do NOT add a newline or trim whitespace
# indent_style=tab seems safer but is probably not necessary
indent_style = tab
trim_trailing_whitespace = false
insert_final_newline = false
5 changes: 4 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-License-Identifier Apache-2.0
# Source: https:/dmyersturnbull/typed-dfs
#
# Various static code analysis and checks
# Runs on commit or pull (to any branch)
# and on a schedule (weekly)
Expand All @@ -11,7 +14,7 @@ on:
jobs:
markdown-link-check:
name: Check Markdown links
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# SPDX-License-Identifier Apache-2.0
# Source: https:/dmyersturnbull/typed-dfs
#
# Build, test, and publish to releases, packages, PyPi, etc.
# Runs when creating a Github release
# Runs when creating a GitHub release
name: Publish on release creation
on:
release:
Expand All @@ -8,17 +11,17 @@ on:
types: [release-made]
jobs:
deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.11"
- name: Install build meta-dependencies
run: |
pip install poetry tox
pip install 'tox>=4' 'poetry-core>=1.4' 'wheel>=0.36,<1.0'
- name: Test with tox
run: |
tox -v
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/pull-test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-License-Identifier Apache-2.0
# Source: https:/dmyersturnbull/typed-dfs
#
# Runs tests via tox
# Runs on pull requests to main
name: Test on pull request
Expand All @@ -10,8 +13,8 @@ jobs:
strategy:
max-parallel: 1
matrix:
os: ["ubuntu-20.04", "windows-2019", "macos-10.15"]
python-version: ["3.9"]
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.11"]
runs-on: "${{ matrix.os }}"
steps:
- name: Checkout
Expand All @@ -22,7 +25,7 @@ jobs:
python-version: "${{ matrix.python-version }}"
- name: Install build meta-dependencies
run: |
pip install tox poetry 'wheel>=0.36,<1.0'
pip install 'tox>=4' 'poetry-core>=1.4' 'wheel>=0.36,<1.0'
- name: Test with tox
run: |
tox -v
13 changes: 8 additions & 5 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-License-Identifier Apache-2.0
# Source: https:/dmyersturnbull/typed-dfs
#
# Build, test, and run static analyses, and send reports to external services
# Runs only on pushing to main
name: Build & test
Expand All @@ -9,8 +12,8 @@ jobs:
strategy:
max-parallel: 1
matrix:
os: ["ubuntu-20.04", "windows-2019", "macos-10.15"]
python-version: ["3.9"]
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.11"]
runs-on: "${{ matrix.os }}"
steps:
- name: Checkout
Expand All @@ -21,8 +24,8 @@ jobs:
python-version: "${{ matrix.python-version }}"
- name: Install build meta-dependencies
run: |
pip install poetry tox 'wheel>=0.36,<1.0'
- name: Test with tox
pip install 'tox>=4' 'poetry-core>=1.4' 'wheel>=0.36,<1.0'
- name: Test with tox>=4
run: |
tox -v
- name: Update coveralls
Expand All @@ -31,4 +34,4 @@ jobs:
run: |
pip install 'coveralls>=3,<4'
coveralls --service=github
if: ${{ matrix.os }} == ubuntu-20.04
if: ${{ matrix.os }} == ubuntu-latest
66 changes: 37 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,68 @@
# SPDX-License-Identifier Apache-2.0
# Source: https:/dmyersturnbull/typed-dfs
#
# Check out https://pre-commit.com/ for documentation
# and https://pre-commit.com/hooks.html for more hooks
minimum_pre_commit_version: 2.20.0
minimum_pre_commit_version: 3.3.3
repos:
# --- Built-in hooks --
- repo: https:/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-symlinks
- id: check-executables-have-shebangs
- id: check-case-conflict
- id: fix-byte-order-marker
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-toml
- id: check-json
- id: fix-encoding-pragma
args: ["--remove"]
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]
- id: check-symlinks
- id: check-yaml
exclude: ^recipes/.*
# --- Commit messages ---
- id: end-of-file-fixer
- id: fix-byte-order-marker
exclude: "^tests/(?:resources|data)/"
- id: fix-encoding-pragma
args: [--remove]
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace

# --- Commit msg checks ---
- repo: https:/commitizen-tools/commitizen
rev: v2.28.0
rev: v3.5.2
hooks:
- id: commitizen
stages: ["commit-msg"]
# --- Strip output from .ipynb files ---
- repo: https:/kynan/nbstripout
rev: 0.6.0

- repo: https:/asottile/pyupgrade
rev: v3.7.0
hooks:
- id: nbstripout
files: ".ipynb"
# --- Linters ---
- id: pyupgrade
args: [--py310-plus]

- repo: https:/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
args: [--profile, black]

- repo: https:/psf/black
rev: 22.6.0
rev: 23.3.0
hooks:
- id: black

- repo: https:/asottile/blacken-docs
rev: v1.12.1
rev: 1.14.0
hooks:
- id: blacken-docs
additional_dependencies: ["black==22.6.0"]

- repo: https:/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
stages: [commit]
args: [--print-width, "100"]
exclude: ^recipes/.*
- repo: https:/nbQA-dev/nbQA
rev: 1.4.0

- repo: https:/macisamuele/language-formatters-pre-commit-hooks
rev: v2.9.0
hooks:
- id: nbqa-black
- id: pretty-format-ini
args: [--autofix]
9 changes: 6 additions & 3 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# SPDX-License-Identifier Apache-2.0
# Source: https:/dmyersturnbull/typed-dfs
#
build:
environment:
python: 3.10.5
python: 3.11.4
nodes:
my-tests:
dependencies:
before:
- "pip install --upgrade 'tox>=3.21,<4.0'"
- "pip install --upgrade 'poetry>=1.1.4,<2.0'"
- "pip install --upgrade 'tox>=4.6,<5'"
- "pip install --upgrade 'poetry-core>=1.4,<2'"
analysis:
project_setup:
override:
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
Adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.18.0] - 2023-07-12

### Added

- Support for Pandas 2

### Removed

- Support for Python < 3.10
- Support for Pandas < 1.5.2
- Support for Poetry < 1.4

### Fixed

- Use poetry-core and new Poetry options
- Enable virtualenv>20.0.33
- Switch to Furo theme

## [0.17.0] - 2022-07-25

### Added
Expand Down
2 changes: 0 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Copyright 2016–2021 Douglas Myers-Turnbull

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python version compatibility](https://img.shields.io/pypi/pyversions/typeddfs?label=Python)](https://pypi.org/project/typeddfs)
[![Version on GitHub](https://img.shields.io/github/v/release/dmyersturnbull/typed-dfs?include_prereleases&label=GitHub)](https:/dmyersturnbull/typed-dfs/releases)
[![Version on PyPi](https://img.shields.io/pypi/v/typeddfs?label=PyPi)](https://pypi.org/project/typeddfs)
[![Build (Actions)](https://img.shields.io/github/workflow/status/dmyersturnbull/typed-dfs/Build%20&%20test?label=Tests)](https:/dmyersturnbull/typed-dfs/actions)
[![Version on PyPi](https://img.shields.io/pypi/v/typeddfs?label=PyPi)](https://pypi.org/project/typeddfs)
[![Build (Actions)](https://img.shields.io/github/actions/workflow/status/dmyersturnbull/typed-dfs/push-main.yml?branch=main&label=Tests)](https:/dmyersturnbull/typed-dfs/actions)
[![Coverage (coveralls)](https://coveralls.io/repos/github/dmyersturnbull/typed-dfs/badge.svg?branch=main&service=github)](https://coveralls.io/github/dmyersturnbull/typed-dfs?branch=main)
[![Documentation status](https://readthedocs.org/projects/typed-dfs/badge)](https://typed-dfs.readthedocs.io/en/stable/)
[![Maintainability](https://api.codeclimate.com/v1/badges/6b804351b6ba5e7694af/maintainability)](https://codeclimate.com/github/dmyersturnbull/typed-dfs/maintainability)
Expand Down Expand Up @@ -162,7 +162,7 @@ Here are the extras:
- `xlsb`: rare binary Excel file (uses: pyxlsb)
- [HDF5](https://www.hdfgroup.org/solutions/hdf5/) _{no extra provided}_ (_use:_ `tables`)

For example, for Feather and TOML support use: `typeddfs[feather,toml]`
For example, for Feather and TOML support use: `typeddfs[feather,toml]`
As a shorthand for all formats, use `typeddfs[all]`.

### 📊 Serialization in-depth
Expand Down
18 changes: 5 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-License-Identifier Apache-2.0
# Source: https:/dmyersturnbull/typed-dfs
#
"""
Sphinx config file.
Uses several extensions to get API docs and sourcecode.
Expand All @@ -16,7 +19,7 @@
T = TypeVar("T")


def find(key: str, default: Optional[T] = None, as_type: Type[T] = str) -> Optional[T]:
def find(key: str, default: T | None = None, as_type: type[T] = str) -> T | None:
"""
Gets a value from pyproject.toml, or a default.
Args:
Expand Down Expand Up @@ -68,18 +71,7 @@ def find(key: str, default: Optional[T] = None, as_type: Type[T] = str) -> Optio
autoapi_python_class_content = "both"
autoapi_member_order = "groupwise"
autoapi_options = ["private-members", "undoc-members", "special-members"]

# The vast majority of Sphinx themes are unmaintained
# This includes the commonly used alabaster theme
# The readthedocs theme is pretty good anyway
# These can be specific to the theme, or processed by Sphinx directly
# https://www.sphinx-doc.org/en/master/usage/configuration.html
html_theme = "sphinx_rtd_theme"
html_theme_options = dict(
collapse_navigation=False,
navigation_depth=False,
style_external_links=True,
)
html_theme = "furo"

# doc types to build
sphinx_enable_epub_build = False
Expand Down
5 changes: 0 additions & 5 deletions docs/requirements.txt

This file was deleted.

Loading

0 comments on commit 13dc088

Please sign in to comment.