Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file removed .DS_Store
Binary file not shown.
Binary file removed .coverage
Binary file not shown.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

Binary file removed .github/.DS_Store
Binary file not shown.
90 changes: 90 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Auto Release

on:
push:
branches:
- main
- master

jobs:
auto-release:
runs-on: ubuntu-latest
permissions:
contents: write # Required to create tags and releases
id-token: write # Required for trusted publishing to PyPI

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for tag detection

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Get latest tag
id: get_version
run: |
# Get the latest tag matching v1.0.*
LATEST_TAG=$(git tag -l "v1.0.*" | sort -V | tail -1)

if [ -z "$LATEST_TAG" ]; then
# No tags exist, start with v1.0.0
NEW_VERSION="v1.0.0"
else
# Extract patch number and increment
PATCH=$(echo $LATEST_TAG | sed 's/v1.0.//')
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="v1.0.$NEW_PATCH"
fi

echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "Next version: $NEW_VERSION"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Update version in code
run: |
VERSION="${{ steps.get_version.outputs.new_version }}"
# Remove 'v' prefix for Python version
PYTHON_VERSION="${VERSION#v}"

# Update __init__.py
sed -i.bak "s/__version__ = .*/__version__ = \"$PYTHON_VERSION\"/" gators/__init__.py
rm gators/__init__.py.bak || true

- name: Build package
run: python -m build

- name: Check package
run: twine check dist/*

- name: Create and push tag
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag ${{ steps.get_version.outputs.new_version }}
git push origin ${{ steps.get_version.outputs.new_version }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.new_version }}
name: Release ${{ steps.get_version.outputs.new_version }}
draft: false
prerelease: false
files: dist/*
generate_release_notes: true

# Uncomment to auto-publish to PyPI
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# skip-existing: true
# # Use trusted publishing or add:
# # password: ${{ secrets.PYPI_API_TOKEN }}
124 changes: 64 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,88 @@
name: build and test
name: Tests

on:
push:
branches:
- main
- master
- develop
pull_request:
branches:
- main
- master
- develop

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: 'pip'

- name: Install linting tools
run: |
python -m pip install --upgrade pip
pip install black==24.4.2 isort==5.13.2

- name: Check formatting with black
run: black --check gators/

- name: Sort the imports with isort
run: isort --check-only --profile black gators/

# - name: Type check with mypy
# run: mypy gators/

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.9]
os: [ubuntu-latest] #ubuntu-latest [macos-latest, ] #

env:
PYTHON_VERSION: ${{ matrix.python-version }}
SPARK_VERSION: ${{ matrix.spark-version }}
PANDAS_VERSION: ${{ matrix.pandas-version }}
PYARROW_VERSION: ${{ matrix.pyarrow-version }}
NUMPY_VERSION: ${{ matrix.numpy-version }}
DEFAULT_INDEX_TYPE: ${{ matrix.default-index-type }}
KOALAS_TESTING: 1
SPARK_LOCAL_IP: 127.0.0.1
# DISPLAY=0.0 does not work in Github Actions with Python 3.5. Here we work around with xvfb-run
PYTHON_EXECUTABLE: xvfb-run python
GITHUB_OAUTH_KEY: ${{ secrets.GITHUB_TOKEN }}
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-latest]
include:
- python-version: "3.13"
os: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install libomp
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
brew install libomp
fi
shell: bash
- name: install dependencies
run: |
pip install --upgrade pip
pip install certifi
pip install tox tox-wheel tox-gh-actions
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements_tox.txt
python setup_build.py build_ext --inplace
python setup_build.py install
- name: tests
run: |
coverage run --omit gators/*/test*.py -m pytest gators && coverage report && coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
cache: 'pip'

- name: Install libomp on macOS
if: runner.os == 'macOS'
run: brew install libomp

# run: |
# - name: Test with tox
# run: tox
# with:
# token: {{ secrets.CODECOV_TOKEN }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

# - run: coverage run -m pytest gators && coverage report && coverage xml

# token: 'ce68bafd-388e-42e8-abf8-b5ea3b328037'
- name: Run tests with coverage
run: |
pytest

- name: Build wheel
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
run: |
python -m pip install build
python -m build

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install tox tox-wheel tox-gh-actions
# pip install numpy<1.20.0
# pip install Cython
# - name: Test with tox
# run: tox
- name: Upload wheel
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
uses: actions/upload-artifact@v4
with:
name: dist-packages
path: dist/
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python, actions
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish to PyPI

on:
release:
types: [published]
workflow_dispatch: # Allow manual trigger

jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for trusted publishing
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Build package
run: python -m build

- name: Check package
run: twine check dist/*

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# Uses trusted publishing by default (recommended)
# No token needed if you configure trusted publishing at PyPI
# Alternatively, use a token:
# password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
Binary file not shown.
8 changes: 0 additions & 8 deletions .tox/log/py36-0.log

This file was deleted.

12 changes: 0 additions & 12 deletions .tox/log/py36-1.log

This file was deleted.

Loading
Loading