Skip to content

Commit

Permalink
Minor fixes to publish r2papi-python
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jan 10, 2024
1 parent f6e583e commit 6d0fbec
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 12 deletions.
12 changes: 10 additions & 2 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
all build:
python setup.py build
python setup.py build sdist

test:
make -C test min
Expand All @@ -11,4 +11,12 @@ clean:
install:
python setup.py install

.PHONY: all test clean install
pub publish: all
# python3 -m twine upload -u __token__ --repository testpypi dist/*
# python3 -m twine upload --repository https://pypi.python.org dist/*
twine upload -u __token__ --repository-url https://upload.pypi.org/legacy/ --verbose dist/*

twine:
sudo pip install -U twine

.PHONY: all test clean install twine
8 changes: 6 additions & 2 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# R2Papi for Python

This is PoC of the future autogenerated API bindings for r2pipe.

## Usage example

We need to have a common API definition for all languages across r2pipe.

```python
import r2pipe
from r2api import R2Api
from r2papi import R2Api

r = R2Ap (r2pipe.open("/bin/ls"))
r = R2Api (r2pipe.open("/bin/ls"))
if r.info().stripped:
print "This binary is stripped"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 7 additions & 6 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
long_description = f.read()

setup(
name='r2api',
version='0.1.0',
packages=['r2api'],
description='High level API for radare2 pipe',
name='r2papi',
version='0.1.2',
packages=['r2papi'],
description='High level API on top of r2pipe',
long_description_content_type='text/markdown',
long_description=long_description,
url='https://rada.re',
url='https://www.radare.org',
author='radare2',
install_requires=['r2pipe'],
project_urls={
'Source': 'https://github.com/radare/radare2-r2pipe-api/',
'Source': 'https://github.com/radare/radare2-r2papi/',
},
)
4 changes: 2 additions & 2 deletions python/test/minimum.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import r2pipe
import r2api
import r2papi

api = r2api.R2Api("/bin/ls")
api = r2papi.R2Api("/bin/ls")
print(api.info().arch)
api.quit()

0 comments on commit 6d0fbec

Please sign in to comment.