-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup: Modernize the setup.py and add a MANIFEST.in
- Loading branch information
Showing
2 changed files
with
29 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
recursive-include zanthor * | ||
include README.md | ||
include LICENSE.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
import os | ||
|
||
APP_NAME = "zanthor" | ||
DESCRIPTION = open("README.md").read() | ||
from setuptools import setup, find_packages | ||
|
||
METADATA = { | ||
"name": APP_NAME, | ||
"version": "1.2.4a1", | ||
"license": "GPL", | ||
"description": "Zanthor is a game where you play an evil robot castle which is powered by steam. @zanthorgame #python #pygame", | ||
"author": "zanthor.org", | ||
"author_email": "[email protected]", | ||
"url": "http://github.com/pygame/zanthor/", | ||
"classifiers": [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: End Users/Desktop", | ||
"Intended Audience :: Information Technology", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: OS Independent", | ||
setup( | ||
name='zanthor', | ||
version="1.2.4a1", | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)', | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
|
@@ -33,97 +23,25 @@ | |
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Software Development :: Libraries :: pygame", | ||
'Topic :: Software Development :: Libraries :: pygame', | ||
'Topic :: Games/Entertainment :: Arcade', | ||
"Topic :: Games/Entertainment :: Real Time Strategy", | ||
], | ||
"py2exe.target": "", | ||
#'py2exe.icon':'icon.ico', #64x64 | ||
"py2exe.binary": APP_NAME, # leave off the .exe, it will be added | ||
"py2app.target": APP_NAME, | ||
"py2app.icon": "icon.icns", # 128x128 | ||
#'cx_freeze.cmd':'~/src/cx_Freeze-3.0.3/FreezePython', | ||
"cx_freeze.cmd": "cxfreeze", | ||
"cx_freeze.target": "%s_linux" % APP_NAME, | ||
"cx_freeze.binary": APP_NAME, | ||
} | ||
|
||
|
||
cmdclass = {} | ||
PACKAGEDATA = { | ||
"cmdclass": cmdclass, | ||
"package_dir": { | ||
"zanthor": "zanthor", | ||
license='GPL', | ||
author="Aaron, Phil, Rene, Tim", | ||
author_email="[email protected]", | ||
maintainer='Rene Dudfield', | ||
maintainer_email='[email protected]', | ||
description="Zanthor is a game where you play an evil robot castle which is powered by steam. @zanthorgame #python #pygame", | ||
url="http://github.com/pygame/zanthor/", | ||
include_package_data=True, | ||
long_description='Zanthor is a game where you play an evil robot castle which is powered by steam.', | ||
package_dir={'zanthor': 'zanthor'}, | ||
packages=find_packages(), | ||
install_requires=['pygame'], | ||
entry_points={ | ||
'console_scripts': [ | ||
'zanthor=zanthor.main:main', | ||
], | ||
}, | ||
"packages": [ | ||
"zanthor", | ||
"zanthor.pgu", | ||
"zanthor.pgu.gui", | ||
], | ||
"scripts": ["scripts/zanthor"], | ||
} | ||
|
||
PACKAGEDATA.update(METADATA) | ||
|
||
|
||
from distutils.core import setup | ||
import sys | ||
import glob | ||
import os | ||
import shutil | ||
|
||
try: | ||
cmd = sys.argv[1] | ||
except IndexError: | ||
print("Usage: setup.py install|sdist") | ||
raise SystemExit | ||
|
||
|
||
# utility for adding subdirectories | ||
def add_files(dest, generator): | ||
for dirpath, dirnames, filenames in generator: | ||
for name in "CVS", ".svn": | ||
if name in dirnames: | ||
dirnames.remove(name) | ||
|
||
for name in filenames: | ||
if "~" in name: | ||
continue | ||
suffix = os.path.splitext(name)[1] | ||
if suffix in (".pyc", ".pyo"): | ||
continue | ||
if name[0] == ".": | ||
continue | ||
filename = os.path.join(dirpath, name) | ||
dest.append(filename) | ||
|
||
|
||
# define what is our data | ||
_DATA_DIR = os.path.join("zanthor", "data") | ||
data = [] | ||
add_files(data, os.walk(_DATA_DIR)) | ||
|
||
|
||
# data_dirs = [os.path.join(f2.replace(_DATA_DIR, 'data'), '*') for f2 in data] | ||
data_dirs = [os.path.join(f2.replace(_DATA_DIR, "data")) for f2 in data] | ||
PACKAGEDATA["package_data"] = {"zanthor": data_dirs} | ||
|
||
|
||
data.extend(glob.glob("*.txt")) | ||
data.extend(glob.glob("*.md")) | ||
# data.append('MANIFEST.in') | ||
# define what is our source | ||
src = [] | ||
add_files(src, os.walk("zanthor")) | ||
src.extend(glob.glob("*.py")) | ||
|
||
|
||
# build the sdist target | ||
if cmd not in "py2exe py2app cx_freeze".split(): | ||
f = open("MANIFEST.in", "w") | ||
for l in data: | ||
f.write("include " + l + "\n") | ||
for l in src: | ||
f.write("include " + l + "\n") | ||
f.close() | ||
|
||
setup(**PACKAGEDATA) | ||
) |