Skip to content

Commit

Permalink
v2.1.0: New project structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo R. 'Gustavo6046' Rehermann committed Oct 21, 2018
1 parent 2ea5b1d commit c6e1e79
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 9 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
**/__pycache__
build
dist
*.zip
*.exe
*.dec
*.json
**/*.zip
**/*.exe
*.dec
25 changes: 25 additions & 0 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"vtrack_version": "2.1.0",
"name": "ZDCode",
"packageName": "zdcode",
"tags": ["zdoom", "decorate", "compiler"],
"description": "A language that compiles to Zandronum-compatible DECORATE syntax.",

"license": "MIT",
"dependencies": [
"parsy>=1.2.0"
],

"authorName": "Gustavo6046",
"authorRealName": "Gustavo R. Rehermann",
"authorEmail": "[email protected]",

"versions": [
{
"name": "2.0.1",
"changes": [
"Adopted the VTrack version description format."
]
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions make_exe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import subprocess
import os
import shutil


try:
import PyInstaller

except ImportError:
subprocess.call(['python', '-m', 'pip', 'install', '-U', 'git+https://github.com/pyinstaller/pyinstaller.git'])


subprocess.call(['python', '-m', 'PyInstaller', 'zdcode/__main__.py', '-n', 'ZDCode', '-i', 'zdcode.ico', '-F', '--specpath', 'build'])

os.unlink('./ZDCode.exe')
shutil.move('dist/ZDCode.exe', './ZDCode.exe')
shutil.rmtree('dist')
1 change: 0 additions & 1 deletion pycompile.bat

This file was deleted.

49 changes: 49 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from setuptools import setup, find_packages
from os import path

try:
import simplejson as json

except ImportError:
import json


if not path.isfile('changelog.json'):
try:
import yaml

except ImportError:
raise ImportError("Module yaml not found to compile changelog.yml!")

with open('changelog.json', 'w') as jfp:
with open('changelog.yml') as yfp:
json.dump(yaml.load(yfp), jfp)

with open('changelog.json') as fp:
changelog = json.load(fp)

# read the contents of README file
this_dir = path.abspath(path.dirname(__file__))

long_description = None

if path.isfile('README.md'):
with open(path.join(this_dir, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

setup(
name=changelog['name'],
version=changelog['versions'][-1]['name'],
packages=[changelog['packageName']],

# metadata to display on PyPI
author=changelog['authorName'],
author_email=changelog['authorEmail'],
description=changelog.get('description', ''),
license=changelog['license'],
keywords=" ".join([x.replace(' ', '-') for x in changelog['tags']]),
install_requires=changelog['dependencies'],

long_description=long_description,
long_description_content_type=('text/markdown' if long_description is not None else None)
)
2 changes: 1 addition & 1 deletion general.py → zdcode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
import textwrap
import zdlexer
import zdcode.zdlexer



Expand Down
6 changes: 3 additions & 3 deletions zdcode.py → zdcode/__main__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import traceback
import sys
import general
import zdcode

if __name__ == "__main__":
try:
dec = general.ZDCode.parse(open(sys.argv[1]).read()).decorate()
dec = zdcode.ZDCode.parse(open(sys.argv[1]).read()).decorate()
open(sys.argv[2], "w").write(dec)
print("Wrote to file successfully.")

Expand All @@ -23,4 +23,4 @@
print("No data to use! Provide as stdin or as arguments.")
sys.exit(1)

open(sys.argv[2]).write(general.ZDCode.parse("".join(data)).decorate())
open(sys.argv[2]).write(zdcode.ZDCode.parse("".join(data)).decorate())
File renamed without changes.

0 comments on commit c6e1e79

Please sign in to comment.