diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 1aba38f..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include LICENSE diff --git a/axuy/__init__.py b/axuy/__init__.py index 711291a..b8e0246 100644 --- a/axuy/__init__.py +++ b/axuy/__init__.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with Axuy. If not, see . -__doc__ = """Axuy is a minimalist peer-to-peer first-person shooter. +"""Axuy is a minimalist peer-to-peer first-person shooter. This package provides abstractions for writing custom front-ends and AIs. All classes and helper functions are exposed at the package level. @@ -25,11 +25,12 @@ Some superclasses may define abstract methods which must be overridden in derived classes. Subclasses only document newly introduced attributes. """ -from .misc import * -from .pico import * -from .peer import * -from .display import * from .control import * +from .display import * +from .misc import * +from .peer import * +from .pico import * __all__ = (misc.__all__ + pico.__all__ + peer.__all__ + display.__all__ + control.__all__) +__version__ = peer.__version__ diff --git a/axuy/__main__.py b/axuy/__main__.py index 6ec7ffe..7129825 100644 --- a/axuy/__main__.py +++ b/axuy/__main__.py @@ -19,7 +19,7 @@ __doc__ = 'Axuy main loop' __all__ = ['main'] -from .control import CtlConfig, Control +from .control import Control, CtlConfig def main(): diff --git a/axuy/display.py b/axuy/display.py index 524bbe0..a6c23f0 100644 --- a/axuy/display.py +++ b/axuy/display.py @@ -32,9 +32,9 @@ import numpy as np from PIL import Image from pyrr import matrix44 -from .peer import PeerConfig, Peer -from .pico import TETRAVERTICES, OCTOVERTICES, SHARD_LIFE from .misc import abspath, color, mirror +from .peer import Peer, PeerConfig +from .pico import OCTOVERTICES, SHARD_LIFE, TETRAVERTICES CONWAY = 1.303577269034 ABRTN_MAX = 0.42069 diff --git a/axuy/peer.py b/axuy/peer.py index 3566a8d..3df9c96 100644 --- a/axuy/peer.py +++ b/axuy/peer.py @@ -26,7 +26,7 @@ from configparser import ConfigParser from os.path import join as pathjoin, pathsep from pickle import dumps, loads from queue import Empty, Queue -from socket import socket, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR +from socket import SO_REUSEADDR, SOCK_DGRAM, SOL_SOCKET, socket from sys import stdout from threading import Thread from typing import Iterator, Tuple diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6a44bcb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = ['flit_core >=2,<3'] +build-backend = 'flit_core.buildapi' + +[tool.flit.metadata] +module = 'axuy' +author = 'Nguyễn Gia Phong' +author-email = 'mcsinyx@disroot.org' +home-page = 'https://github.com/McSinyx/axuy' +requires = ['appdirs', 'glfw>=1.8', 'moderngl', + 'numpy', 'Pillow', 'pyrr', 'setuptools'] +description-file = 'README.md' +classifiers = [ + 'Development Status :: 3 - Alpha', + 'Environment :: MacOS X', + 'Environment :: Win32 (MS Windows)', + 'Environment :: X11 Applications', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', + 'Natural Language :: English', + 'Operating System :: OS Independent', + '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 :: Only', + 'Topic :: Games/Entertainment :: First Person Shooters'] +requires-python = '>=3.6' +keywords = 'fps,p2p,opengl,glfw' +license = 'AGPLv3+' + +[tool.flit.entrypoints.console_scripts] +axuy = "axuy.__main__:main" diff --git a/setup.py b/setup.py deleted file mode 100755 index d65dc85..0000000 --- a/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -from setuptools import setup - -with open('README.md') as f: - long_description = f.read() - -setup( - name='axuy', - version='0.0.10', - description='Minimalist first-person shooter', - long_description=long_description, - long_description_content_type='text/markdown', - url='https://github.com/McSinyx/axuy', - author='Nguyễn Gia Phong', - author_email='vn.mcsinyx@gmail.com', - license='AGPLv3+', - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Environment :: MacOS X', - 'Environment :: Win32 (MS Windows)', - 'Environment :: X11 Applications', - 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', - 'Natural Language :: English', - 'Operating System :: OS Independent', - '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 :: Only', - 'Topic :: Games/Entertainment :: First Person Shooters'], - keywords='fps p2p opengl glfw', - packages=['axuy'], - install_requires=['appdirs', 'numpy', 'pyrr', - 'moderngl', 'glfw>=1.8', 'Pillow'], - package_data={'axuy': ['map.npy', 'shaders/*', - 'icon.png', 'settings.ini']}, - entry_points={'console_scripts': ['axuy = axuy.__main__:main']}) diff --git a/tools/aisample b/tools/aisample index fccb6cb..d562d7e 100755 --- a/tools/aisample +++ b/tools/aisample @@ -20,8 +20,8 @@ from itertools import chain from time import time -from axuy import (INV, RCOLL, PICO_SPEED, SHARD_LIFE, neighbors, - Shard, Peer, Display, DispConfig) +from axuy import (INV, PICO_SPEED, RCOLL, SHARD_LIFE, + DispConfig, Display, Peer, Shard, neighbors) from numpy import floor from numpy.linalg import norm diff --git a/tox.ini b/tox.ini index b9bf329..60f24ac 100644 --- a/tox.ini +++ b/tox.ini @@ -1,3 +1,21 @@ +[tox] +envlist = py +minversion = 3.3 +isolated_build = True + +[testenv] +deps = + flake8-builtins + isort +commands = + flake8 + isort -c --diff + [flake8] -ignore = E226, E701, E704 -exclude = setup.py, __init__.py +ignore = E226, E701, E704, W503 +exclude = __init__.py + +[isort] +balanced_wrapping = True +combine_as_imports = True +known_third_party = axuy