|
1 | 1 | #!/usr/bin/env python
|
2 | 2 |
|
3 |
| -from peachpy import __version__ |
4 | 3 | import distutils.log
|
| 4 | +from distutils.command.build import build |
| 5 | +from setuptools.command.develop import develop |
5 | 6 | from distutils.cmd import Command
|
6 |
| -from distutils.core import setup |
7 |
| - |
| 7 | +from setuptools import setup |
8 | 8 |
|
9 | 9 | def read_text_file(path):
|
10 | 10 | import os
|
11 | 11 | with open(os.path.join(os.path.dirname(__file__), path)) as f:
|
12 | 12 | return f.read()
|
13 | 13 |
|
14 | 14 |
|
| 15 | +class BuildGenerateInstructions(build): |
| 16 | + def run(self): |
| 17 | + self.run_command("generate") |
| 18 | + build.run(self) |
| 19 | + |
| 20 | +class DevelopGenerateInstructions(develop): |
| 21 | + def run(self): |
| 22 | + self.run_command("generate") |
| 23 | + develop.run(self) |
| 24 | + |
15 | 25 | class GenerateInstructions(Command):
|
16 | 26 | description = "Generate Peach-Py instructions from Opcodes DB"
|
17 | 27 | user_options = []
|
@@ -39,7 +49,7 @@ def run(self):
|
39 | 49 |
|
40 | 50 | setup(
|
41 | 51 | name="PeachPy",
|
42 |
| - version=__version__, |
| 52 | + version="0.2.0", |
43 | 53 | description="Portable Efficient Assembly Codegen in Higher-level Python",
|
44 | 54 | author="Marat Dukhan",
|
45 | 55 | author_email="maratek@gmail.com",
|
@@ -77,6 +87,10 @@ def run(self):
|
77 | 87 | "Topic :: Software Development :: Compilers",
|
78 | 88 | "Topic :: Software Development :: Libraries"
|
79 | 89 | ],
|
| 90 | + setup_requires=["Opcodes==0.3.10", "six"], |
| 91 | + install_requires=["six", "enum34"], |
80 | 92 | cmdclass={
|
81 |
| - "generate": GenerateInstructions |
| 93 | + "build": BuildGenerateInstructions, |
| 94 | + "develop": DevelopGenerateInstructions, |
| 95 | + "generate": GenerateInstructions, |
82 | 96 | })
|
0 commit comments