Skip to content

Commit

Permalink
Merge pull request #60 from JaskRendix/toml
Browse files Browse the repository at this point in the history
pyproject.toml + isort
  • Loading branch information
bitcraft authored Jan 15, 2024
2 parents 7ce82e4 + 02df9b3 commit dae50ec
Show file tree
Hide file tree
Showing 15 changed files with 760 additions and 217 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9' ]
python-version: ['3.7', '3.8', '3.9']
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand Down
675 changes: 675 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prune .github
exclude .gitignore
12 changes: 7 additions & 5 deletions apps/demo/demo-stitched.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@

import pygame
from pygame.locals import (
K_UP,
K_DOWN,
K_LEFT,
K_RIGHT,
K_MINUS,
K_EQUALS,
K_ESCAPE,
K_LEFT,
K_MINUS,
K_RIGHT,
K_UP,
KEYDOWN,
QUIT,
VIDEORESIZE,
K_r,
)
from pygame.locals import KEYDOWN, VIDEORESIZE, QUIT
from pytmx.util_pygame import load_pygame

import pyscroll
Expand Down
9 changes: 5 additions & 4 deletions apps/demo/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
See the "Quest" tutorial for a more simple use with
pygame sprites and groups.
"""
from pytmx.util_pygame import load_pygame
import pygame
import pyscroll
import pyscroll.data
import collections
import logging

import pygame
from pygame.locals import *
from pytmx.util_pygame import load_pygame

import pyscroll
import pyscroll.data
import pyscroll.orthographic

logger = logging.getLogger(__name__)
Expand Down
15 changes: 13 additions & 2 deletions apps/tutorial/quest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@
from typing import List

import pygame
from pygame.locals import K_UP, K_DOWN, K_LEFT, K_RIGHT, K_MINUS, K_EQUALS, K_ESCAPE, K_r
from pygame.locals import KEYDOWN, VIDEORESIZE, QUIT
from pygame.locals import (
K_DOWN,
K_EQUALS,
K_ESCAPE,
K_LEFT,
K_MINUS,
K_RIGHT,
K_UP,
KEYDOWN,
QUIT,
VIDEORESIZE,
K_r,
)
from pytmx.util_pygame import load_pygame

import pyscroll
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
165 changes: 0 additions & 165 deletions license.txt

This file was deleted.

44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "pyscroll"
version = "2.31"
description = "Fast scrolling maps library for pygame"
readme = "README.md"
license = {file = "LICENSE"}
authors = [
{name = "bitcraft", email = "[email protected]"}
]
classifiers = [
"Intended Audience :: Developers",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Games/Entertainment",
"Topic :: Multimedia :: Graphics",
"Topic :: Software Development :: Libraries :: pygame",
]
requires-python = ">=3.7"

[project.urls]
source = "https://github.com/bitcraft/pyscroll"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["."]
include = ["pyscroll*"]

[tool.black]
line-length = 88
target-version = ["py37"]

[tool.isort]
line_length = 88
profile = "black"
skip_gitignore = true
2 changes: 1 addition & 1 deletion pyscroll/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
except ImportError:
pass

from .common import rect_to_bb, RectLike, Vector2DInt
from .animation import AnimationFrame, AnimationToken
from .common import RectLike, Vector2DInt, rect_to_bb

__all__ = (
"PyscrollDataAdapter",
Expand Down
1 change: 1 addition & 0 deletions pyscroll/isometric.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def _initialize_buffers(self, view_size):
:return: None
"""
import math

from pygame import Rect

tw, th = self.data.tile_size
Expand Down
9 changes: 2 additions & 7 deletions pyscroll/orthographic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@
import math
import time
from itertools import chain, product
from typing import List, TYPE_CHECKING, Callable
from typing import TYPE_CHECKING, Callable, List

import pygame
from pygame import Rect, Surface

from .common import (
surface_clipping_context,
RectLike,
Vector2D,
Vector2DInt,
)
from .common import RectLike, Vector2D, Vector2DInt, surface_clipping_context
from .quadtree import FastQuadTree

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion pyscroll/quadtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import annotations

import itertools
from typing import TYPE_CHECKING, Tuple, Set, Sequence
from typing import TYPE_CHECKING, Sequence, Set, Tuple

from pygame import Rect

Expand Down
27 changes: 1 addition & 26 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,4 @@
# python3 -m twine upload --repository pypi dist/*
from setuptools import setup

setup(
name="pyscroll",
version="2.31",
description="Fast scrolling maps library for pygame",
author="bitcraft",
author_email="[email protected]",
url="https://github.com/bitcraft/pyscroll",
packages=["pyscroll"],
license="LGPLv3",
long_description="see readme.md",
package_data={"pyscroll": ["license.txt", "readme.md"]},
classifiers=[
"Intended Audience :: Developers",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Games/Entertainment",
"Topic :: Multimedia :: Graphics",
"Topic :: Software Development :: Libraries :: pygame",
],
)
setup()
6 changes: 4 additions & 2 deletions tests/pyscroll/test_pyscroll.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from unittest import mock
import unittest
from unittest import mock

import pygame
from pyscroll.orthographic import BufferedRenderer

from pyscroll.data import PyscrollDataAdapter
from pyscroll.orthographic import BufferedRenderer


class DummyDataAdapter(PyscrollDataAdapter):
Expand Down

0 comments on commit dae50ec

Please sign in to comment.