Skip to content

Commit

Permalink
Merge pull request #2 from pygame/ghrelease
Browse files Browse the repository at this point in the history
Would you like your cheese gift wrapped? YES PLEASE I AM EVIL CASTLE ZANTHOR OF COURSE WRAP IT
  • Loading branch information
illume authored Apr 27, 2024
2 parents 6828da9 + 38c9e82 commit 0d509f7
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 108 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.dev.txt ]; then python -m pip install -r requirements.dev.txt; fi
python -m pip install build
- name: Build package
run: python -m build --no-isolation
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recursive-include zanthor *
include README.md
include LICENSE.txt
134 changes: 26 additions & 108 deletions setup.py
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.3",
"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://www.zanthor.org/",
"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",
Expand All @@ -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)
)
3 changes: 3 additions & 0 deletions zanthor/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if __name__ == "__main__":
import zanthor.main
zanthor.main.main()

0 comments on commit 0d509f7

Please sign in to comment.