Skip to main content

A tool for extracting of OS-Specific Tests

Project description

Tests PyPI - Python Version

OSTDetector

An automated tool for extracting OS-specific Tests from Git repositories written in Python. The ostdetector (Operating System-Specific Tests Detector) is primarily designed to be used as a command-line tool. With ostdetector, you can easily extract information about the OS-specific Tests from the Git repository (only python files are analyzed). The set of OS-specific Tests are saved in a given CSV file.

Install

The easiest way to install ostdetector is to install from Pypi

pip install -i https://test.pypi.org/simple/ ostdetector==1.0.5

Alternatively, you can install from test environment

pip install --index-url https://test.pypi.org/simple/ --no-deps ostdetector

You may wish to use this tool in a virtual environment. You can use the following commands.

virtualenv ostdetector_venv
source ostdetector_venv/bin/activate
pip install ostdetector

Quick examples

As an example, the following command extracts every OS-Specific Testes from the repository ricardojob/ostdetector. It also saves various information (line, module, filename ...) in directory dir_output. This information will be available in the output file.

ostdetector ricardojob/ostdetector -o dir_output

Note that the tool also can fetch it. For example, the GitHub repository https://github.com/ricardojob/ostdetector will be fetched, saved under the dir_output/ricardojob directory. Note that, by default all projects are cloned to the data directory.

Usage

After installation, the ostdetector command-line tool should be available in your shell. Otherwise, please replace ostdetector by python -m ostdetector. The explanations in the following stays valid in both cases.

You can use ostdetector with the following arguments:

Usage: ostdetector [OPTIONS] REPOSITORY

  Extract the usage of OS-Specific Tests from a single Git repository
  `REPOSITORY`. The Git repository can be remote. It will be pulled locally in
  the folder `data`. Every extracted OS-Specific Tests will be written in the
  dir given to `-o`, or in the `data' if not specified.

  Example of usage: python main.py ricardojob/OSTDetector -o data_experiment

Options:
  -o, --output DIRECTORY  The output dir where the usage of OS-Specific Tests
                          related to the repository will be stored. By
                          default, the information will written to `data' dir.
  -h, --help              Show this message and exit.

The *compare.csv' file given to directory -o` will contain the following columns:

  • project_name: the name of the repository
  • project_hash: the commit SHA of the commit where the OS-specific tests file was extracted
  • line: the line where the OS-specific tests usage occurs
  • module: the module that packages the OS-specific tests (e.g., sys)
  • package: the API (e.g., platform)
  • platform: the information about OS (e.g, win32)
  • file: the file name
  • function: the function name
  • method_type: the method type (method_test or support)
  • url: the URL that represents the API usage on Github

License

Distributed under MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ostdetector-1.0.3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ostdetector-1.0.3-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file ostdetector-1.0.3.tar.gz.

File metadata

  • Download URL: ostdetector-1.0.3.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ostdetector-1.0.3.tar.gz
Algorithm Hash digest
SHA256 518566c6b56c21ff804f30fff750447d779457b638607c33f19cc9b42beb5d86
MD5 00cfb5d232491b871f23228efde23168
BLAKE2b-256 c56ae822d108b56741697ef6fa359653ea21607c0d69dfc6436ee09102bb9b7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ostdetector-1.0.3.tar.gz:

Publisher: python-publish.yml on ricardojob/OSTDetector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ostdetector-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: ostdetector-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ostdetector-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a25c36a0220768442f44462cb4a0d06031e0c04a2f0da3a345da35bbb2e172e
MD5 4280ad23fcc27cfbe0b367c22c02fade
BLAKE2b-256 57512d873080d33f7a5dfda14cadd0811b80b576c0079dcbe33a15e272cb8798

See more details on using hashes here.

Provenance

The following attestation bundles were made for ostdetector-1.0.3-py3-none-any.whl:

Publisher: python-publish.yml on ricardojob/OSTDetector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page