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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 59 additions & 41 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,64 @@
{
"name": "Fugue Development Environment",
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.10",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.defaultInterpreterPath": "/usr/local/bin/python",
"editor.defaultFormatter": "ms-python.black-formatter",
"isort.interpreter": [
"/usr/local/bin/python"
],
"flake8.interpreter": [
"/usr/local/bin/python"
],
"pylint.interpreter": [
"/usr/local/bin/python"
],
"black-formatter.interpreter": [
"/usr/local/bin/python"
]
},
"extensions": [
"ms-python.python",
"ms-python.isort",
"ms-python.flake8",
"ms-python.pylint",
"ms-python.mypy",
"ms-python.black-formatter",
"GitHub.copilot",
"njpwerner.autodocstring"
]
}
},
"forwardPorts": [
8888
],
"postCreateCommand": "make devenv",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.11.0": {},
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.11-bookworm",
"hostRequirements": {
"cpus": 4,
"memory": "16gb",
"storage": "32gb"
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.defaultInterpreterPath": ".venv/bin/python",
"python.pythonPath": ".venv/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
},
"notebook.python.defaultInterpreterPath": ".venv/bin/python",
"notebook.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"ruff.nativeServer": "on",
"python.languageServer": "Default",
"debug.internalConsoleOptions": "neverOpen",
"extensions.ignoreRecommendations": true,
"files.insertFinalNewline": true
},
"extensions": [
"ms-python.python",
"ms-python.mypy",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter@2025.2.0",
"charliermarsh.ruff@2025.22.0",
"GitHub.copilot",
"tamasfe.even-better-toml",
"anthropic.claude-code"
]
}
},
"forwardPorts": [
8888
],
"containerEnv": {
"UV_NO_SYNC": "1"
},
"onCreateCommand": "make devenv",
"postCreateCommand": "make init_codespace",
"waitFor": "postCreateCommand",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.12.4": {},
"ghcr.io/va-h/devcontainers-features/uv:1.1.4": {},
"ghcr.io/devcontainers/features/java:1": {
"version": "11"
}
}
},
"ghcr.io/devcontainers/features/node:1.6.3": {}
}
}
17 changes: 13 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,29 @@ on:
pull_request:
branches: [ master ]

env:
UV_NO_SYNC: 1

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Clone repo
uses: actions/checkout@v5

- name: Setup uv ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: false
cache-dependency-glob: "pyproject.toml"
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: make devenv

- name: Lint
run: make lint
61 changes: 36 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Publish
name: Publish to PyPI

on:
release:
types: [created]
push:
tags:
- 'v*'

jobs:
deploy:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/tune
permissions:
contents: read
id-token: write # Required for trusted publishing (OIDC)
env:
UV_PYTHON: "3.11"

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.8'
- name: Install dependencies
run: make devenv
- name: Test
if: "!github.event.release.prerelease"
run: make test
- name: Build and publish
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
make package
twine upload dist/*
- name: Checkout code
uses: actions/checkout@v5

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: false
cache-dependency-glob: "pyproject.toml"

- name: Setup devenv
run: >
make devenv

- name: Validate release tag
run: >
uv run -m scripts.validate_release

- name: Build package
run: uv build

- name: Publish to PyPI
run: uv publish
17 changes: 12 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Clone repo
uses: actions/checkout@v5

- name: Setup uv ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: false
cache-dependency-glob: "pyproject.toml"
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: make devenv

- name: Test
run: make test

- name: "Upload coverage to Codecov"
if: matrix.python-version == '3.10'
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/testwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: [ 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [ 3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Clone repo
uses: actions/checkout@v5

- name: Setup uv ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
enable-cache: false
cache-dependency-glob: "pyproject.toml"
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: make devenv

- name: Test
run: make testcore
33 changes: 7 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,11 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-vcs-permalinks
- repo: https://github.com/pycqa/flake8
rev: '3.8.3'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: flake8
types: [python]
additional_dependencies:
- flake8-bugbear
- flake8-builtins
# - flake8-docstrings # TODO: add back!
# - flake8-rst-docstrings
- flake8-comprehensions
- flake8-tidy-imports
- pycodestyle
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.6.0
hooks:
- id: pylint
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
types: [python]
language_version: python3
- id: ruff
files: api
args: [--fix]
- id: ruff-format
files: api
27 changes: 21 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ help:
@echo " test run all tests with coverage (assumes venv is present)"

devenv:
pip3 install -r requirements.txt
pre-commit install
uv sync --quiet --all-groups --all-extras --frozen
uv run --no-sync pre-commit install

init_codespace:
npm install -g @anthropic-ai/claude-code
npm i -g mint
git pull || true
uv sync --quiet --all-groups --all-extras --frozen

dev:
pip3 install -r requirements.txt
Expand All @@ -22,13 +28,12 @@ docs:
sphinx-apidoc --no-toc -f -t=docs/_templates -o docs/api tune_hyperopt/
sphinx-apidoc --no-toc -f -t=docs/_templates -o docs/api tune_optuna/
sphinx-apidoc --no-toc -f -t=docs/_templates -o docs/api tune_sklearn/
sphinx-apidoc --no-toc -f -t=docs/_templates -o docs/api tune_tensorflow/
sphinx-apidoc --no-toc -f -t=docs/_templates -o docs/api tune_notebook/
sphinx-apidoc --no-toc -f -t=docs/_templates -o docs/api tune_test/
sphinx-build -b html docs/ docs/build/

lint:
pre-commit run --all-files
uv run pre-commit run --all-files

package:
rm -rf dist/*
Expand All @@ -41,7 +46,17 @@ lab:
jupyter lab --port=8888 --ip=0.0.0.0 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.allow_origin='*'

test:
python3 -bb -m pytest tests
uv run pytest tests

testcore:
python3 -bb -m pytest tests/tune tests/tune_notebook tests/tune_hyperopt tests/tune_optuna
uv run pytest tests/tune tests/tune_notebook tests/tune_hyperopt tests/tune_optuna

release_branch:
$(eval VERSION := $(shell python -c "import tune_version; print(tune_version.__version__)"))
@if echo "$(VERSION)" | grep -q "dev"; then \
git tag v$(VERSION); \
git push origin v$(VERSION); \
else \
echo "Error: Can only release dev versions (current: $(VERSION))"; \
exit 1; \
fi
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes

## 0.1.7

- Remove dependency on package `fs`
- Move to uv

## 0.1.6

- Support Python 3.12
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"fugue": ("https://fugue.readthedocs.io/en/latest", None),
"tutorial": ("https://fugue-tutorials.readthedocs.io/en/latest", None),
"pa": ("https://arrow.apache.org/docs", None),
"fs": ("https://docs.pyfilesystem.org/en/latest", None),
"spark": ("https://spark.apache.org/docs/latest/api/python", None),
"dask": ("https://docs.dask.org/en/latest", None),
"np": ("https://numpy.org/doc/stable", None),
Expand Down
Loading