Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f2b37f7
in `codec.pyx` the `PyInt_AS_LONG` replaced by the `PyLong_AsSsize_t`
Jun 9, 2026
9bf1220
in `utils.pyx` removed "_" from imported PyFloat pack/unpack functions
Jun 9, 2026
9ed0036
checks `isinstance(x, (int, long))` replaced by isinstance(x, int)
Jun 9, 2026
c025d59
removed dropped fn `PyInt_Check(key)`
Jun 9, 2026
0f8d6d7
the `PyUnicode_GET_SIZE` by the `PyUnicode_GET_LENGTH` and `PyUnicode…
Jun 9, 2026
3a224ea
implementation of the new MoudleFinder compatible with python >=3.11
Jun 9, 2026
d3f27be
usage of the `__import__(x)` replaced by calling the `importlib.impor…
Jun 9, 2026
347747e
running compilation on python 3.12+ and cython 3.1+. Older versions a…
Jun 12, 2026
99166ca
Merge pull request #2 from elmordo/new-cython-support
elmordo Jun 26, 2026
53db168
added build system requirements constraints
Jun 26, 2026
d917fdc
update of classifiers to match new lib compatibility
Jun 26, 2026
0d29282
Merge branch 'refs/heads/new-cython-support'
Jun 27, 2026
b887f2e
new function returning explicit list of binary extensions for compila…
Jun 27, 2026
abcfec0
removed functions related to the old extension build process
Jun 27, 2026
ac8fa23
removed test related logic from setup.py
Jun 27, 2026
6e10197
import source of the `Distribution` in the setup.py changed from `dis…
Jun 27, 2026
062883a
removed legacy build configuration from the setup.py
Jun 28, 2026
7a43458
the setupinfo.py removed from the repo (the code was merged into the …
Jun 28, 2026
96c7914
requirements and classifiers moved from the setup.py into the pyproje…
Jun 28, 2026
f7cb327
minimal python version is set to the 3.12
Jun 28, 2026
73205fc
tool configuration migrated from the setup.cfg into the pyproject.toml
Jun 28, 2026
2e1a385
modification of the .travis.yml to cover only new python releases and…
Jun 28, 2026
da0a90e
the readme update
Jun 28, 2026
0a62a77
removed requirements.txt
Jun 28, 2026
a2f4f54
source files moved to the "src" directory
Jun 28, 2026
ba660d2
added correct include dirs to the Extension definitions
Jun 28, 2026
7b3edff
fix of incorrect setup of the package source directories
Jun 30, 2026
f17d36e
removed unused import from the setup.py
Jun 30, 2026
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ cpyamf/codec.pyd
cpyamf/util.pyd
dist
file_model
pyamf/_version.py
src/pyamf/_version.py
# coverage
.coverage
.noseids
Expand Down
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.12"
- "3.13"
- "3.14"
sudo: false

cache:
Expand Down Expand Up @@ -44,14 +43,13 @@ matrix:
# env: GAESDK_VERSION=1.9.30

install:
- pip install -r requirements.txt
- pip install coverage coveralls
- pip install -e .
- pip install -e .[test]
- ./install_optional_dependencies.sh
- ./maybe_install_cython.sh

script:
- coverage run --source=pyamf setup.py test
- coverage run --source=pyamf pytest ./pyamf

after_success:
- coveralls
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ include *.md
global-exclude *.swf
global-exclude *.pyc
include cpyamf/*.pyx
include cpyamf/*.pxd
include cpyamf/*.pxd
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,57 @@ If you want to make it fast, please send PR.
This was tested on Ubuntu 16.04.2 and macOS 10.12.4

To install, you can use pip3 on your environment.

```
pip3 install Py3AMF
pip install py3amf
```

Or, you can use setup.py to develop.
```
git clone git@github.com:StdCarrot/Py3AMF.git
cd Py3AMF
# python3 setup.py test
python3 setup.py install
# pip install -e .[test] && pytest ./pyamf
pip install -e .
```

The binary extension is compiled by default. To disable it, use the `PYAMF_DISABLE_EXT` env
variable.

```shell
PYAMF_DISABLE_EXT=1 pip install py3amf
# or
PYAMF_DISABLE_EXT=1 pip install -e .
```

### Simple example
Everything is same with PyAMF, but you have to concern str and bytes types.

```python
import pyamf
from pyamf import remoting
from src.pyamf import remoting
from pyamf.flex import messaging
import uuid
import requests

msg = messaging.RemotingMessage(operation='retrieveUser',
destination='so.stdc.flexact.common.User',
messageId=str(uuid.uuid4()).upper(),
body=['user_id'])
msg = messaging.RemotingMessage(
operation='retrieveUser',
destination='so.stdc.flexact.common.User',
messageId=str(uuid.uuid4()).upper(),
body=['user_id']
)
req = remoting.Request(target='UserService', body=[msg])
ev = remoting.Envelope(pyamf.AMF3)
ev = remoting.Envelope(pyamf.AMF3)
ev['/0'] = req

# Encode request
bin_msg = remoting.encode(ev)

# Send request; You can use other channels like RTMP
resp = requests.post('http://example.com/amf',
data=bin_msg.getvalue(),
headers={'Content-Type': 'application/x-amf'})
resp = requests.post(
'http://example.com/amf',
data=bin_msg.getvalue(),
headers={'Content-Type': 'application/x-amf'}
)

# Decode response
resp_msg = remoting.decode(resp.content)
Expand Down
15 changes: 12 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,25 @@ To install, you can use pip3 on your environment.

::

pip3 install Py3AMF
pip3 install py3amf

Or, you can use setup.py to develop.

::

git clone git@github.com:StdCarrot/Py3AMF.git
cd Py3AMF
# python3 setup.py test
python3 setup.py install
# pip install -e .[test] && pytest ./pyamf
pip install -e .

The binary extension is compiled by default. To disable it, use the `PYAMF_DISABLE_EXT` env
variable.

::

PYAMF_DISABLE_EXT=1 pip install py3amf
# or
PYAMF_DISABLE_EXT=1 pip install -e .

Simple example
~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/examples/apache/mod_python.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pyamf.remoting.gateway.wsgi import WSGIGateway
from src.pyamf.remoting import WSGIGateway

import logging

Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/examples/apache/mod_wsgi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pyamf.remoting.gateway.wsgi import WSGIGateway
from src.pyamf.remoting import WSGIGateway

def echo(data):
return data
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorials/examples/gateways/appengine/client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging

from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService



logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
Expand Down
6 changes: 3 additions & 3 deletions doc/tutorials/examples/gateways/cherrypy/client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging

from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService



logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
Expand All @@ -13,4 +13,4 @@
gw = RemotingService(path, logger=logging)
service = gw.getService('myservice')

print service.echo('Hello World!')
print service.echo('Hello World!')
4 changes: 2 additions & 2 deletions doc/tutorials/examples/gateways/turbogears/mygateway.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from pyamf.remoting.gateway.wsgi import WSGIGateway
from src.pyamf.remoting import WSGIGateway


logging.basicConfig(
Expand All @@ -27,4 +27,4 @@ def scramble(self, text):
# Expose our services
services = {"Services" : Services()}

GatewayController = WSGIGateway(services, logger=logging, debug=True)
GatewayController = WSGIGateway(services, logger=logging, debug=True)
6 changes: 3 additions & 3 deletions doc/tutorials/examples/gateways/twisted/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService

import logging

logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
Expand All @@ -15,4 +15,4 @@
print service1.testn('Hello World')

service2 = client.getService('myadd')
print service2(1,2)
print service2(1,2)
14 changes: 7 additions & 7 deletions doc/tutorials/examples/gateways/twisted/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from pyamf.remoting.gateway.wsgi import WSGIGateway
from src.pyamf.remoting import WSGIGateway
from pyamf.remoting.gateway import expose_request

from twisted.web import server
Expand All @@ -9,7 +9,7 @@
from twisted.internet import reactor
from twisted.application import service, strports


logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
Expand All @@ -35,15 +35,15 @@ def testn(self, request, n):


# A standalone function that can be bound to a service.
def add(a, b):
return a + b
def add(a, b):
return a + b


# Create a dictionary mapping the service namespaces to a function
# or class instance
services = {
services = {
'example': example(),
'myadd': add
'myadd': add
}

# Create and start a thread pool,
Expand All @@ -64,4 +64,4 @@ def add(a, b):

# Hooks for twistd
application = service.Application('PyAMF Sample Remoting Server')
server.setServiceParent(application)
server.setServiceParent(application)
6 changes: 3 additions & 3 deletions doc/tutorials/examples/gateways/werkzeug/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService

import logging

logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
Expand All @@ -12,4 +12,4 @@
service = client.getService('echo')
echo = service('Hello World!')

logging.debug(echo)
logging.debug(echo)
4 changes: 2 additions & 2 deletions doc/tutorials/examples/general/client/authentication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService

client = RemotingService('https://demo.pyamf.org/gateway/authentication')
client.setCredentials('jane', 'doe')
Expand All @@ -7,4 +7,4 @@
print service.sum(85, 115) # should print 200.0

client.setCredentials('abc', 'def')
print service.sum(85, 115).description # should print Authentication Failed
print service.sum(85, 115).description # should print Authentication Failed
4 changes: 2 additions & 2 deletions doc/tutorials/examples/general/client/basic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService

client = RemotingService('http://demo.pyamf.org/gateway/recordset')
service = client.getService('service')

print service.getLanguages()
print service.getLanguages()
2 changes: 1 addition & 1 deletion doc/tutorials/examples/general/client/exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
>>> from pyamf.remoting.client import RemotingService
>>> from src.pyamf.remoting import RemotingService
>>> gateway = RemotingService('http://example.org/gw')
>>> service = gateway.getService('type_error')
>>> service()
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/examples/general/client/headers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService

gw = RemotingService('http://demo.pyamf.org/gateway/recordset')

Expand Down
4 changes: 2 additions & 2 deletions doc/tutorials/examples/general/client/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService

import logging
logging.basicConfig(level=logging.DEBUG,
Expand All @@ -8,4 +8,4 @@
client = RemotingService(gateway, logger=logging)
service = client.getService('service')

print service.getLanguages()
print service.getLanguages()
2 changes: 1 addition & 1 deletion doc/tutorials/examples/general/client/referer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService

appReferer = 'client.py'
gateway = 'http://demo.pyamf.org/gateway/helloworld'
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/examples/general/client/user_agent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pyamf.remoting.client import RemotingService
from src.pyamf.remoting import RemotingService

appName = 'MyApp/0.1.0'
gateway = 'http://demo.pyamf.org/gateway/helloworld'
Expand Down
Loading