Skip to content

Commit a16bbf9

Browse files
committed
Imporved packaging.
Metadata has been moved into setup.cfg. Added pyproject.toml.
1 parent ec7df9b commit a16bbf9

File tree

4 files changed

+23
-64
lines changed

4 files changed

+23
-64
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build-system]
2+
requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]

requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

setup.cfg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[metadata]
2+
name = plasma
3+
version = 1.0
4+
license = GPL-3.0
5+
description = plasma disassembler for x86/ARM/MIPS
6+
url = https://github.com/joelpx/plasma
7+
8+
[options]
9+
install_requires = pefile; pyelftools; msgpack
10+
packages= plasma, plasma.lib, plasma.lib.arch, plasma.lib.arch.x86, plasma.lib.arch.mips, plasma.lib.arch.arm, plasma.lib.ui, plasma.lib.fileformat, plasma.lib.fileformat.relocations, plasma.scripts
11+
12+
[options.entry_points]
13+
console_scripts = plasma = plasma.main:console_entry

setup.py

Lines changed: 5 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,13 @@
11
# -*- coding: utf-8 -*-
22

3-
try:
4-
from setuptools import setup, find_packages
5-
except ImportError:
6-
from distutils.core import setup
7-
8-
try:
9-
from pip._internal.req import parse_requirements
10-
except ImportError:
11-
from pip.req import parse_requirements
3+
from setuptools import setup, find_packages
124

135
from distutils.core import Extension
14-
import plasma
15-
16-
requirements = parse_requirements('requirements.txt', session=False)
17-
18-
requires = []
19-
for item in requirements:
20-
# we want to handle package names and also repo urls
21-
if getattr(item, 'url', None): # older pip has url
22-
links.append(str(item.url))
23-
if getattr(item, 'link', None): # newer pip has link
24-
links.append(str(item.link))
25-
if item.req:
26-
requires.append(str(item.req))
27-
28-
29-
x86_analyzer = Extension('plasma.lib.arch.x86.analyzer',
30-
sources = ['plasma/lib/arch/x86/analyzer.c'])
31-
32-
mips_analyzer = Extension('plasma.lib.arch.mips.analyzer',
33-
sources = ['plasma/lib/arch/mips/analyzer.c'])
34-
35-
arm_analyzer = Extension('plasma.lib.arch.arm.analyzer',
36-
sources = ['plasma/lib/arch/arm/analyzer.c'])
37-
386

397
setup(
40-
name='plasma',
41-
version='1.0',
42-
url="https://github.com/joelpx/plasma",
43-
description='plasma disassembler for x86/ARM/MIPS',
44-
license="GPLv3",
458
ext_modules=[
46-
x86_analyzer,
47-
mips_analyzer,
48-
arm_analyzer,
49-
],
50-
packages=['plasma',
51-
'plasma.lib',
52-
'plasma.lib.arch',
53-
'plasma.lib.arch.x86',
54-
'plasma.lib.arch.mips',
55-
'plasma.lib.arch.arm',
56-
'plasma.lib.ui',
57-
'plasma.lib.fileformat',
58-
'plasma.lib.fileformat.relocations',
59-
'plasma.scripts',
60-
],
61-
package_dir={'plasma':'plasma'},
62-
install_requires=requires,
63-
entry_points = {
64-
"console_scripts": [
65-
"plasma = plasma.main:console_entry",
66-
],
67-
},
9+
Extension('plasma.lib.arch.x86.analyzer', sources = ['plasma/lib/arch/x86/analyzer.c']),
10+
Extension('plasma.lib.arch.mips.analyzer', sources = ['plasma/lib/arch/mips/analyzer.c']),
11+
Extension('plasma.lib.arch.arm.analyzer', sources = ['plasma/lib/arch/arm/analyzer.c']),
12+
]
6813
)

0 commit comments

Comments
 (0)