~cnx/axuy

1783e5644021498409f6ff06488c7506a3d15f0b — Nguyễn Gia Phong 3 years ago d6b3adc main
Support PEP 621 and s/appdirs/loca/
4 files changed, 22 insertions(+), 21 deletions(-)

R LICENSE => COPYING
M axuy/__init__.py
M axuy/peer.py
M pyproject.toml
R LICENSE => COPYING +0 -0
M axuy/__init__.py => axuy/__init__.py +2 -2
@@ 31,5 31,5 @@ from .misc import *
from .peer import *
from .pico import *

__all__ = (misc.__all__ + pico.__all__ + peer.__all__
           + display.__all__ + control.__all__)
__all__ = [__version__, *misc.__all__, *pico.__all__,
           *peer.__all__, *display.__all__, *control.__all__]

M axuy/peer.py => axuy/peer.py +5 -7
@@ 24,7 24,7 @@ from abc import ABC, abstractmethod
from argparse import ArgumentParser, FileType, RawTextHelpFormatter
from configparser import ConfigParser
from importlib.resources import open_text, read_text
from os.path import join as pathjoin, pathsep
from os.path import pathsep
from pickle import dumps, loads
from queue import Empty, Queue
from socket import SO_REUSEADDR, SOCK_DGRAM, SOL_SOCKET, socket


@@ 32,7 32,7 @@ from sys import stdout
from threading import Thread
from typing import Iterator, Tuple

from appdirs import AppDirs
from loca import Loca

from .misc import mapgen, mapidgen
from .pico import Pico


@@ 56,10 56,8 @@ class PeerConfig:
    """

    def __init__(self) -> None:
        dirs = AppDirs(appname='axuy', appauthor=False, multipath=True)
        parents = dirs.site_config_dir.split(pathsep)
        parents.append(dirs.user_config_dir)
        filenames = [pathjoin(parent, 'settings.ini') for parent in parents]
        loca = Loca().user.config
        filenames = [d/'settings.ini' for d in (*loca.shared(), loca())]

        # Parse configuration files
        self.config = ConfigParser()


@@ 79,7 77,7 @@ class PeerConfig:
        self.options.add_argument(
            '-c', '--config', metavar='PATH',
            help=('location of the configuration file'
                  f' (fallback: {pathsep.join(filenames)})'))
                  f' (fallback: {pathsep.join(map(str, filenames))})'))
        self.options.add_argument(
            '--host',
            help=f'host to bind this peer to (fallback: {self.host})')

M pyproject.toml => pyproject.toml +15 -12
@@ 1,14 1,14 @@
[build-system]
requires = ['flit_core >=2,<3']
requires = ['flit_core >=3.2,<4']
build-backend = 'flit_core.buildapi'

[tool.flit.metadata]
module = 'axuy'
author = 'Nguyễn Gia Phong'
author-email = 'mcsinyx@disroot.org'
home-page = 'https://sr.ht/~cnx/axuy'
requires = ['appdirs', 'glfw>=1.8', 'moderngl', 'numpy', 'Pillow', 'pyrr']
description-file = 'README.md'
[project]
name = 'axuy'
readme = 'README.md'
requires-python = '>=3.7'
license = { file = 'COPYING' }
authors = [ { name = 'Nguyễn Gia Phong', email = 'mcsinyx@disroot.org' } ]
keywords = [ 'fps', 'p2p', 'opengl', 'glfw' ]
classifiers = [
    'Development Status :: 3 - Alpha',
    'Environment :: MacOS X',


@@ 23,9 23,12 @@ classifiers = [
    'Programming Language :: Python :: 3.9',
    'Programming Language :: Python :: 3 :: Only',
    'Topic :: Games/Entertainment :: First Person Shooters']
requires-python = '>=3.7'
keywords = 'fps,p2p,opengl,glfw'
license = 'AGPLv3+'
dependencies = [ 'glfw>=1.8', 'loca', 'moderngl', 'numpy', 'Pillow', 'pyrr' ]
dynamic = [ 'version', 'description' ]

[project.urls]
SourceHut = 'https://sr.ht/~cnx/axuy'
# Matrix = 'matrix:r/axuy:halogen.city'

[tool.flit.entrypoints.console_scripts]
[project.scripts]
axuy = 'axuy.__main__:main'