add pyproject.toml [fixes #110]

This commit is contained in:
ihaveahax 2024-11-03 01:08:08 -06:00
parent 2936596d26
commit c3734b91ee
No known key found for this signature in database
2 changed files with 75 additions and 48 deletions

72
pyproject.toml Normal file
View File

@ -0,0 +1,72 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "ninfs"
description = "FUSE filesystem Python scripts for Nintendo console files"
authors = [
{ name = "Ian Burgwin", email = "ian@ianburgwin.net" },
]
readme = "README.md"
license = {text = "MIT"}
dynamic = ["version"]
requires-python = ">= 3.8"
classifiers = [
"Topic :: Utilities",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"pyctr>=0.5.1,<0.8",
"haccrypto>=0.1",
"pycryptodomex>=3.9,<4",
"pypng>=0.0.21",
"setuptools>=61.0.0",
"mfusepy>=1.0.0",
]
[project.gui-scripts]
ninfsw = "ninfs.main:gui"
[project.scripts]
mount_3ds = "ninfs.main:main"
mount_3dsx = "ninfs.main:main"
mount_app = "ninfs.main:main"
mount_cci = "ninfs.main:main"
mount_cdn = "ninfs.main:main"
mount_cfa = "ninfs.main:main"
mount_cia = "ninfs.main:main"
mount_csu = "ninfs.main:main"
mount_cxi = "ninfs.main:main"
mount_exefs = "ninfs.main:main"
mount_nand = "ninfs.main:main"
mount_nandbb = "ninfs.main:main"
mount_nandctr = "ninfs.main:main"
mount_nanddsi = "ninfs.main:main"
mount_nandhac = "ninfs.main:main"
mount_nandique = "ninfs.main:main"
mount_nandnx = "ninfs.main:main"
mount_nandswitch = "ninfs.main:main"
mount_nandtwl = "ninfs.main:main"
mount_ncch = "ninfs.main:main"
mount_nds = "ninfs.main:main"
mount_romfs = "ninfs.main:main"
mount_sd = "ninfs.main:main"
mount_sdtitle = "ninfs.main:main"
mount_srl = "ninfs.main:main"
mount_threedsx = "ninfs.main:main"
ninfs = "ninfs.main:gui"
[tool.setuptools.dynamic]
version = {attr = "ninfs.__version__"}
[tool.setuptools.packages.find]
where = ["."]
include = ["ninfs.*"]

View File

@ -1,49 +1,4 @@
#!/usr/bin/env python3
from setuptools import setup
import sys
from setuptools import setup, find_packages
from ninfs import mountinfo
if sys.hexversion < 0x030800f0:
sys.exit('Python 3.8.0+ is required.')
with open('README.md', 'r', encoding='utf-8') as f:
readme = f.read()
# based on https://github.com/Legrandin/pycryptodome/blob/b3a394d0837ff92919d35d01de9952b8809e802d/setup.py
with open('ninfs/__init__.py', 'r', encoding='utf-8') as f:
for line in f:
if line.startswith('__version__'):
version = eval(line.split('=')[1])
setup(
name='ninfs',
version=version,
packages=find_packages(),
url='https://github.com/ihaveamac/ninfs',
license='MIT',
author='Ian Burgwin',
author_email='ian@ianburgwin.net',
description='FUSE filesystem Python scripts for Nintendo console files',
long_description=readme,
long_description_content_type='text/markdown',
package_data={'ninfs.gui': ['data/*.png', 'data/*.ico', 'data/licenses/*']},
classifiers=[
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
install_requires=['pycryptodomex>=3.9,<4', 'pyctr>=0.7,<0.8', 'haccrypto>=0.1', 'pypng>=0.0.21', 'setuptools>=61.0.0', 'mfusepy>=1.0.0'],
python_requires='>=3.8.0',
# fusepy should be added here once the main repo has a new release with Windows support.
entry_points={'gui_scripts': ['ninfsw = ninfs.main:gui'],
'console_scripts': ['ninfs = ninfs.main:gui'] +
[f'mount_{x} = ninfs.main:main' for x in mountinfo.types.keys()] +
[f'mount_{x} = ninfs.main:main' for x in mountinfo.aliases.keys()]}
)
if __name__ == '__main__':
setup()