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
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
39 changes: 19 additions & 20 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
# This workflow 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: Upload Dofutils Package

on:
release:
types: [ created ]
types: [created]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

env:
UV_PYTHON: "3.14"
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
- name: Install dependencies
run: poetry install
- name: Build
run: poetry build
- name: Publish
run: |
poetry publish -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }}
- name: Checkout
uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v9.0.0

- name: Build package
run: uv build

- name: Publish package
run: uv publish
42 changes: 20 additions & 22 deletions .github/workflows/python-test-publish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# This workflow 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: Upload Dofutils Test Package

on:
push:
branches: [ test_release ]
branches: [test_release]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

env:
UV_PYTHON: "3.14"
UV_PUBLISH_URL: https://test.pypi.org/legacy/
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_TEST_USERNAME }}
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_TEST_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
- name: Checkout
uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v9.0.0

- name: Build package
run: uv build

- name: Publish package to TestPyPI
run: uv publish
118 changes: 42 additions & 76 deletions .github/workflows/python-unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,95 +1,61 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Dofutils CI Full
name: Dofutils CI

on:
push:
branches:
- '**'
- "main"
pull_request:
branches:
- '**'
- "**"

jobs:
linter:
runs-on: ${{ matrix.os }}
name: Lint Python
continue-on-error: true
permissions:
contents: read

jobs:
code-sanitize:
name: Code Sanitize
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', 'pypy3.9']
os: [ ubuntu-latest ]
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
- uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Launch linter
run: poetry run task lint

type-checker:
runs-on: ${{ matrix.os }}
name: TypeChecker Python
continue-on-error: true
- name: Checkout
uses: actions/checkout@v7

strategy:
matrix:
python-version: ['3.11', 'pypy3.9']
os: [ ubuntu-latest ]
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v9.0.0
with:
enable-cache: true

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
- uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Launch type checker
run: poetry run task check
- name: Check code sanitize
run: |
uv sync --all-groups
uv run ruff check .
uv run ruff format --check .
uv run mypy . --exclude '^tests/'

unit-tests:
runs-on: ${{ matrix.os }}
name: Unittest Python
continue-on-error: true

name: Unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', 'pypy3.8', 'pypy3.9']
os: [ ubuntu-latest ]

python-version: ["3.11", "3.12", "3.13", "3.14"]
env:
UV_PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8

- uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Launch unit test
run: poetry run task test
- name: Checkout
uses: actions/checkout@v7

- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v9.0.0
with:
enable-cache: true

- name: Install dependencies
run: uv sync --all-groups

- name: Run unittests
run: uv run task test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.idea/
.mypy_cache/
.ruff_cache/
__pycache__/
build/
dist/
Dofutils.egg-info/
poetry.lock
doc/_build
uv.lock
doc/_build
.devcontainer/devcontainer-lock.json
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ sphinx:
configuration: docs/conf.py

python:
version: "3.8"
version: "3.10"
install:
- requirements: docs/requirements.txt
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
Expand Down
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit",
},
},
"python.formatting.provider": "none",
"python.testing.unittestArgs": [
"-v",
"-s",
Expand Down
82 changes: 75 additions & 7 deletions docs/modules/maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,90 @@ Maps

This shows all the maps objects and usages.

All of these classes are importable from ``dofutils.maps``
These core classes are importable from ``dofutils.maps``.

.. currentmodule:: dofutils.maps


BattleFieldCell
CoordinateCell
---------------

.. autoclass:: BattleFieldCell
.. autoclass:: CoordinateCell
:members:
:undoc-members:

CoordinateCell
---------------
DofusMap
--------

.. autoclass:: CoordinateCell
.. autoclass:: DofusMap
:members:
:undoc-members:

Serialization
-------------

.. autoclass:: CellLayerData
:members:
:undoc-members:

.. autoclass:: GroundCellData
:members:
:undoc-members:

.. autoclass:: InteractiveObjectData
:members:
:undoc-members:

.. autoclass:: CellData
:members:
:undoc-members:

.. autoclass:: DefaultMapDataSerializer
:members:
:undoc-members:

.. autoclass:: EncryptedMapDataSerializer
:members:
:undoc-members:

Sight
-----

All of these classes are importable from ``dofutils.maps.sight``.

.. currentmodule:: dofutils.maps.sight

.. autoclass:: BattlefieldSight
:members:
:undoc-members:

.. autoclass:: CellSight
:members:
:undoc-members:

Pathfinding
-----------

All of these classes are importable from ``dofutils.maps.path``.

.. currentmodule:: dofutils.maps.path

.. autoclass:: Path
:members:
:undoc-members:

.. autoclass:: PathDecoder
:members:
:undoc-members:

.. autoclass:: PathException
:members:
:undoc-members:

.. autoclass:: PathStep
:members:
:undoc-members:

.. autoclass:: Pathfinder
:members:
:undoc-members:

Expand Down
Loading