Skip to content

Imporved packaging. #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']),
]
)