Create AppMap files by recording a Python application.
Project description
About
appmap-python is a Python package for recording
AppMaps of your code. "AppMap" is a data format
which records code structure (modules, classes, and methods), code execution events
(function calls and returns), and code metadata (repo name, repo URL, commit SHA, labels,
etc). It's more granular than a performance profile, but it's less granular than a full
debug trace. It's designed to be optimal for understanding the design intent and structure
of code and key data flows.
Usage
Visit the AppMap for Python reference page on AppLand.com for a complete reference guide.
Development
Getting the code
Clone the repo to begin development.
% git clone https://github.com/applandinc/appmap-python.git
Cloning into 'appmap-python'...
remote: Enumerating objects: 167, done.
remote: Counting objects: 100% (167/167), done.
remote: Compressing objects: 100% (100/100), done.
remote: Total 962 (delta 95), reused 116 (delta 61), pack-reused 795
Receiving objects: 100% (962/962), 217.31 KiB | 4.62 MiB/s, done.
Resolving deltas: 100% (653/653), done.
Python version support
As a package intended to be installed in as many environments as possible, appmap-python
needs to avoid using features of Python or the standard library that were added after the
oldest version currently supported (see the
supported versions).
Dependency management
poetry for dependency management:
% brew install poetry
% cd appmap-python
% poetry install
wrapt
The one dependency that is not managed using poetry is wrapt. Because it's possible that
projects that use appmap may also need an unmodified version of wrapt (e.g. pylint depends on
astroid, which in turn depends on wrapt), we use
vendoring to vendor wrapt.
To update wrapt, use tox (described below) to run the vendoring environment.
Linting
pylint for linting:
% cd appmap-python
% poetry run pylint appmap
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
[Note that the current configuration has a threshold set which must be met for the Travis build to pass. To make this easier to achieve, a number of checks have both been disabled. They should be reenabled as soon as possible.]
Testing
pytest
Note that you must install the dependencies contained in requirements-dev.txt before running tests. See the explanation in pyproject.toml for details.
Additionally, the tests currently require that you set APPMAP=true and
APPMAP_DISPLAY_PARAMS=true.
pytest for testing:
% cd appmap-python
% pip install -r requirements-test.txt
% APPMAP=true APPMAP_DISPLAY_PARAMS=true poetry run pytest
tox
Additionally, the tox configuration provides the ability to run the tests for all
supported versions of Python and Django.
tox requires that all the correct versions of Python to be available to create
the test environments. pyenv is an easy way to manage
multiple versions of Python, and the xxenv-latest
plugin can help get all the latest versions.
% brew install pyenv
% git clone https://github.com/momo-lab/xxenv-latest.git "$(pyenv root)"/plugins/xxenv-latest
% cd appmap-python
% pyenv latest local 3.{9,6,7,8}
% for v in 3.{9,6,7,8}; do pyenv latest install $v; done
% poetry run tox
Code Coverage
coverage for coverage:
% cd appmap-python
% poetry run coverage run -m pytest
% poetry run coverage html
% open htmlcov/index.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file appmap-2.1.9.tar.gz.
File metadata
- Download URL: appmap-2.1.9.tar.gz
- Upload date:
- Size: 109.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f67d8d7e428dfd8a1f53a6448c79f170ed86306eef6d86d90203c9d7669ac041
|
|
| MD5 |
6cdcb6aa40e9b8b2734315b0f58a66ea
|
|
| BLAKE2b-256 |
4cac39a4370630ac3c9d1c2259c31881a95b34aa983a0a1d9fff5a77243ff6e8
|
Provenance
The following attestation bundles were made for appmap-2.1.9.tar.gz:
Publisher:
release.yml on getappmap/appmap-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
appmap-2.1.9.tar.gz -
Subject digest:
f67d8d7e428dfd8a1f53a6448c79f170ed86306eef6d86d90203c9d7669ac041 - Sigstore transparency entry: 908635296
- Sigstore integration time:
-
Permalink:
getappmap/appmap-python@4eaa6d3a45f09f47da114d73cc66271252c9b8b0 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/getappmap
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4eaa6d3a45f09f47da114d73cc66271252c9b8b0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file appmap-2.1.9-py3-none-any.whl.
File metadata
- Download URL: appmap-2.1.9-py3-none-any.whl
- Upload date:
- Size: 86.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
803302fad3ab63960f2afb3ca82ad91a44065e9e7b3ec5342a1017548dc6128d
|
|
| MD5 |
248904408c75ebe6e282c2561d6cfd07
|
|
| BLAKE2b-256 |
cd881f70e6e75b9b4a99eba9a3c0a5b65415d087b4362bf4fd7311a57e4e714d
|
Provenance
The following attestation bundles were made for appmap-2.1.9-py3-none-any.whl:
Publisher:
release.yml on getappmap/appmap-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
appmap-2.1.9-py3-none-any.whl -
Subject digest:
803302fad3ab63960f2afb3ca82ad91a44065e9e7b3ec5342a1017548dc6128d - Sigstore transparency entry: 908635313
- Sigstore integration time:
-
Permalink:
getappmap/appmap-python@4eaa6d3a45f09f47da114d73cc66271252c9b8b0 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/getappmap
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4eaa6d3a45f09f47da114d73cc66271252c9b8b0 -
Trigger Event:
workflow_dispatch
-
Statement type: