Skip to content

Commit

Permalink
Imporved packaging.
Browse files Browse the repository at this point in the history
Metadata has been moved into setup.cfg.
Added pyproject.toml.
  • Loading branch information
KOLANICH committed Aug 31, 2021
1 parent ec7df9b commit 2a50af9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 64 deletions.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

13 changes: 13 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[metadata]
name = plasma
version = 1.0
license = GPL-3.0
description = plasma disassembler for x86/ARM/MIPS
url = https://github.com/joelpx/plasma

[options]
install_requires = pefile; pyelftools; msgpack; capstone
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

[options.entry_points]
console_scripts = plasma = plasma.main:console_entry
65 changes: 5 additions & 60 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,13 @@
# -*- coding: utf-8 -*-

try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup

try:
from pip._internal.req import parse_requirements
except ImportError:
from pip.req import parse_requirements
from setuptools import setup, find_packages

from distutils.core import Extension
import plasma

requirements = parse_requirements('requirements.txt', session=False)

requires = []
for item in requirements:
# we want to handle package names and also repo urls
if getattr(item, 'url', None): # older pip has url
links.append(str(item.url))
if getattr(item, 'link', None): # newer pip has link
links.append(str(item.link))
if item.req:
requires.append(str(item.req))


x86_analyzer = Extension('plasma.lib.arch.x86.analyzer',
sources = ['plasma/lib/arch/x86/analyzer.c'])

mips_analyzer = Extension('plasma.lib.arch.mips.analyzer',
sources = ['plasma/lib/arch/mips/analyzer.c'])

arm_analyzer = Extension('plasma.lib.arch.arm.analyzer',
sources = ['plasma/lib/arch/arm/analyzer.c'])


setup(
name='plasma',
version='1.0',
url="https://github.com/joelpx/plasma",
description='plasma disassembler for x86/ARM/MIPS',
license="GPLv3",
ext_modules=[
x86_analyzer,
mips_analyzer,
arm_analyzer,
],
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',
],
package_dir={'plasma':'plasma'},
install_requires=requires,
entry_points = {
"console_scripts": [
"plasma = plasma.main:console_entry",
],
},
Extension('plasma.lib.arch.x86.analyzer', sources = ['plasma/lib/arch/x86/analyzer.c']),
Extension('plasma.lib.arch.mips.analyzer', sources = ['plasma/lib/arch/mips/analyzer.c']),
Extension('plasma.lib.arch.arm.analyzer', sources = ['plasma/lib/arch/arm/analyzer.c']),
]
)

0 comments on commit 2a50af9

Please sign in to comment.