Skip to content

Commit 0d509f7

Browse files
authored
Merge pull request #2 from pygame/ghrelease
Would you like your cheese gift wrapped? YES PLEASE I AM EVIL CASTLE ZANTHOR OF COURSE WRAP IT
2 parents 6828da9 + 38c9e82 commit 0d509f7

File tree

4 files changed

+71
-108
lines changed

4 files changed

+71
-108
lines changed

.github/workflows/python-publish.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up Python
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: "3.11"
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
if [ -f requirements.dev.txt ]; then python -m pip install -r requirements.dev.txt; fi
32+
python -m pip install build
33+
- name: Build package
34+
run: python -m build --no-isolation
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}

MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
recursive-include zanthor *
2+
include README.md
3+
include LICENSE.txt

setup.py

+26-108
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
1-
import os
21

3-
APP_NAME = "zanthor"
4-
DESCRIPTION = open("README.md").read()
2+
from setuptools import setup, find_packages
53

6-
METADATA = {
7-
"name": APP_NAME,
8-
"version": "1.2.3",
9-
"license": "GPL",
10-
"description": "Zanthor is a game where you play an evil robot castle which is powered by steam. @zanthorgame #python #pygame",
11-
"author": "zanthor.org",
12-
"author_email": "[email protected]",
13-
"url": "http://www.zanthor.org/",
14-
"classifiers": [
15-
"Development Status :: 4 - Beta",
16-
"Intended Audience :: End Users/Desktop",
17-
"Intended Audience :: Information Technology",
18-
"License :: OSI Approved :: BSD License",
19-
"Operating System :: OS Independent",
4+
setup(
5+
name='zanthor',
6+
version="1.2.4a1",
7+
classifiers=[
8+
'Development Status :: 4 - Beta',
9+
'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)',
2010
"Programming Language :: Python :: 2",
2111
"Programming Language :: Python :: 2.7",
2212
"Programming Language :: Python :: 3",
@@ -33,97 +23,25 @@
3323
"Programming Language :: Python :: 3.10",
3424
"Programming Language :: Python :: 3.11",
3525
"Programming Language :: Python :: 3.12",
36-
"Topic :: Software Development :: Libraries :: pygame",
26+
'Topic :: Software Development :: Libraries :: pygame',
27+
'Topic :: Games/Entertainment :: Arcade',
3728
"Topic :: Games/Entertainment :: Real Time Strategy",
3829
],
39-
"py2exe.target": "",
40-
#'py2exe.icon':'icon.ico', #64x64
41-
"py2exe.binary": APP_NAME, # leave off the .exe, it will be added
42-
"py2app.target": APP_NAME,
43-
"py2app.icon": "icon.icns", # 128x128
44-
#'cx_freeze.cmd':'~/src/cx_Freeze-3.0.3/FreezePython',
45-
"cx_freeze.cmd": "cxfreeze",
46-
"cx_freeze.target": "%s_linux" % APP_NAME,
47-
"cx_freeze.binary": APP_NAME,
48-
}
49-
50-
51-
cmdclass = {}
52-
PACKAGEDATA = {
53-
"cmdclass": cmdclass,
54-
"package_dir": {
55-
"zanthor": "zanthor",
30+
license='GPL',
31+
author="Aaron, Phil, Rene, Tim",
32+
author_email="[email protected]",
33+
maintainer='Rene Dudfield',
34+
maintainer_email='[email protected]',
35+
description="Zanthor is a game where you play an evil robot castle which is powered by steam. @zanthorgame #python #pygame",
36+
url="http://github.com/pygame/zanthor/",
37+
include_package_data=True,
38+
long_description='Zanthor is a game where you play an evil robot castle which is powered by steam.',
39+
package_dir={'zanthor': 'zanthor'},
40+
packages=find_packages(),
41+
install_requires=['pygame'],
42+
entry_points={
43+
'console_scripts': [
44+
'zanthor=zanthor.main:main',
45+
],
5646
},
57-
"packages": [
58-
"zanthor",
59-
"zanthor.pgu",
60-
"zanthor.pgu.gui",
61-
],
62-
"scripts": ["scripts/zanthor"],
63-
}
64-
65-
PACKAGEDATA.update(METADATA)
66-
67-
68-
from distutils.core import setup
69-
import sys
70-
import glob
71-
import os
72-
import shutil
73-
74-
try:
75-
cmd = sys.argv[1]
76-
except IndexError:
77-
print("Usage: setup.py install|sdist")
78-
raise SystemExit
79-
80-
81-
# utility for adding subdirectories
82-
def add_files(dest, generator):
83-
for dirpath, dirnames, filenames in generator:
84-
for name in "CVS", ".svn":
85-
if name in dirnames:
86-
dirnames.remove(name)
87-
88-
for name in filenames:
89-
if "~" in name:
90-
continue
91-
suffix = os.path.splitext(name)[1]
92-
if suffix in (".pyc", ".pyo"):
93-
continue
94-
if name[0] == ".":
95-
continue
96-
filename = os.path.join(dirpath, name)
97-
dest.append(filename)
98-
99-
100-
# define what is our data
101-
_DATA_DIR = os.path.join("zanthor", "data")
102-
data = []
103-
add_files(data, os.walk(_DATA_DIR))
104-
105-
106-
# data_dirs = [os.path.join(f2.replace(_DATA_DIR, 'data'), '*') for f2 in data]
107-
data_dirs = [os.path.join(f2.replace(_DATA_DIR, "data")) for f2 in data]
108-
PACKAGEDATA["package_data"] = {"zanthor": data_dirs}
109-
110-
111-
data.extend(glob.glob("*.txt"))
112-
data.extend(glob.glob("*.md"))
113-
# data.append('MANIFEST.in')
114-
# define what is our source
115-
src = []
116-
add_files(src, os.walk("zanthor"))
117-
src.extend(glob.glob("*.py"))
118-
119-
120-
# build the sdist target
121-
if cmd not in "py2exe py2app cx_freeze".split():
122-
f = open("MANIFEST.in", "w")
123-
for l in data:
124-
f.write("include " + l + "\n")
125-
for l in src:
126-
f.write("include " + l + "\n")
127-
f.close()
128-
129-
setup(**PACKAGEDATA)
47+
)

zanthor/__main__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if __name__ == "__main__":
2+
import zanthor.main
3+
zanthor.main.main()

0 commit comments

Comments
 (0)