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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Description
<!--- Describe your changes in detail -->

## Related IssueS
## Related Issues
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
Expand Down
32 changes: 14 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,32 @@ jobs:
# Set up operating system
runs-on: ubuntu-latest

# Define job steps
steps:
- name: Set up Python 3.11.10
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
with:
python-version: "3.11.10"

- name: Check-out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Install poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
- name: Install the latest version of uv
uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82

# Installing only development dependencies (for pre-commit)
# Installing only development dependencies (for pre-commit)
- name: Install development dependencies
run: poetry install --only dev
run: uv sync --only-dev

# Code quality checks:
# Code quality checks:
- name: Initialize pre-commit
run: poetry run pre-commit install
run: uvx pre-commit install
- name: Run pre-commit on all files.
run: poetry run pre-commit run --all-files
run: uvx pre-commit run --all-files

# Run tests:
# Run tests:
- name: Install all dependencies
run: uv sync
- name: Install all dependencies
run: poetry install
run: uv pip install -e .
- name: Run tests
run: poetry run pytest --ignore-glob='test_*.py' ./tests/test_cases/ --cov=sc2_datasets --cov-report term-missing --cov-report html --cov=xml 2>&1
run: uv run pytest --ignore-glob='test_*.py' ./tests/test_cases/ --cov=sc2_datasets --cov-report term-missing --cov-report html --cov-report xml 2>&1

# TODO: This may be ran in docker:
# See if the documentation builds correctly:
- name: Build documentation
run: poetry run make html --directory docs/
run: uv run make html --directory docs/
56 changes: 19 additions & 37 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Python 3.11.10
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
with:
python-version: "3.11.10"

- name: Check-out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0

- name: Install poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78

# Installing dependencies via poetry:
- name: Install packages
run: poetry install
run: uv sync

- name: Build documentation
run: poetry run make html --directory docs/
run: uv run make html --directory docs/

test-pypi:
# Set up operating system
Expand All @@ -40,30 +34,24 @@ jobs:

# Define job steps
steps:
- name: Set up Python 3.11.10
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
with:
python-version: "3.11.10"

- name: Check-out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0

- name: Install poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78

# Installing dependencies via poetry:
- name: Install packages
run: poetry install
run: uv sync

# Building the package:
- name: Build dist with poetry
run: poetry build
- name: Build dist with uv
run: uv build

# Publishing to TestPyPI:
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
user: __token__
repository-url: https://test.pypi.org/legacy/
Expand Down Expand Up @@ -110,30 +98,24 @@ jobs:
id-token: write

steps:
- name: Set up Python 3.11.10
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
with:
python-version: "3.11.10"

- name: Check-out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0

- name: Install poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78

# Installing dependencies via poetry:
- name: Install packages
run: poetry install
run: uv sync

# Building the package:
- name: Build dist with poetry
run: poetry build
- name: Build dist with uv
run: uv build

# Upload to PyPI only if everything else is correct:
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
user: __token__

Expand Down
36 changes: 12 additions & 24 deletions .github/workflows/test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Python 3.11.10
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
with:
python-version: "3.11.10"

- name: Check-out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0

- name: Install poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78

# Installing dependencies via poetry:
- name: Install packages
run: poetry install
run: uv sync

- name: Build documentation
run: poetry run make html --directory docs/
run: uv run make html --directory docs/

test-pypi:
# Set up operating system
Expand All @@ -38,30 +32,24 @@ jobs:

# Define job steps
steps:
- name: Set up Python 3.11.10
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
with:
python-version: "3.11.10"

- name: Check-out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0

- name: Install poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78

# Installing dependencies via poetry:
- name: Install packages
run: poetry install
run: uv sync

# Building the package:
- name: Build dist with poetry
run: poetry build
- name: Build dist with uv
run: uv build

# Publishing to TestPyPI:
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
user: __token__
repository-url: https://test.pypi.org/legacy/
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DEVCONTAINER_GPU = sc2_datasets:devcontainer-gpu

# Test commands:
TEST_COMPOSE = $(DOCKER_DIR)/docker-test-compose.yml
TEST_COMMAND_RAW = poetry run pytest --ignore-glob='test_*.py' ./tests/test_cases/ --cov=sc2_datasets --cov-report term-missing --cov-report html --cov=xml 2>&1
TEST_COMMAND_RAW = uv run pytest --ignore-glob='test_*.py' ./tests/test_cases/ --cov=sc2_datasets --cov-report term-missing --cov-report html --cov=xml 2>&1
TEST_COMMAND = "$(TEST_COMMAND_RAW)"
TEST_COMMAND_LOG = "$(TEST_COMMAND_RAW) | tee /app/logs/test_output.log"

Expand Down Expand Up @@ -56,7 +56,7 @@ action_compose_test: ## Triggered from a GitHub Action to run the tests for CI.
##################################
.PHONY: docs
docs: ## Generates the documentation.
poetry run \
uv run \
make html \
--directory docs/

Expand Down
49 changes: 25 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
[tool.poetry]
[project]
name = "sc2_datasets"
version = "2.1.0"
description = "Library providing PyTorch and PyTorch Lightning API for pre-processed StarCraft II dataset SC2EGSetDataset and other datasets."
authors = ["Andrzej Białecki", "Andrzej Szczap"]
license = "GNU General Public License v3.0"
readme = "README.md"
authors = [{"name" = "Andrzej Białecki"}, {"name" = "Andrzej Szczap"}]
license = "GPL-3.0-only"
requires-python = ">=3.11"
dependencies = [
"lightning>=2.6.1",
"pandas>=3.0.1",
"requests>=2.32.5",
"tqdm>=4.67.3",
]

[dependency-groups]
dev = [
"commitizen>=4.13.9",
"furo>=2025.12.19",
"myst-nb>=1.4.0",
"pre-commit>=4.5.1",
"pytest>=9.0.2",
"pytest-cov>=7.0.0",
"ruff>=0.15.6",
"sphinx-autoapi>=3.8.0",
]


[tool.commitizen]
version = "2.1.0"
version_files = ["pyproject.toml:version"]

[tool.poetry.dependencies]
python = "^3.11"
pytorch-lightning = "^2.5.0"
pandas = "^2.2.3"
tqdm = "^4.67.1"
requests = "^2.32.3"
ijson = "^3.4.0.post0"

[tool.poetry.group.dev.dependencies]
pytest = "^9.0.1"
pytest-cov = "^7.0.0"
myst-nb = "^1.2.0"
sphinx-autoapi = "^3.6.0"
furo = "^2025.9.25"
pre-commit = "^4.2.0"
ruff = "^0.14.7"
commitizen = "^4.6.0"

[tool.ruff]
target-version = "py311"

[tool.ruff.lint]
select = ["I"]


[tool.pytest.ini_options]
markers = [
"minor: marks tests as minor (deselect with '-m \"not minor\"')",
"major",
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["uv_build>=0.9.5,<0.11.0"]
build-backend = "uv_build"
Loading
Loading