GithubHelp home page GithubHelp logo

grammarware / modernity-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cpadm/pyternity

0.0 1.0 0.0 17.34 MB

Deriving Modernity Signatures of Python Codebases with Static Analysis

License: MIT License

Python 100.00%

modernity-python's Introduction

Pyternity

Tool to generate modernity signatures for PyPI projects. Uses Vermin in order to detect features

Getting started

Windows (Sandbox):

In PowerShell:

# MSVC is needed for matplotlib
# Also see: https://github.com/matplotlib/matplotlib/issues/18292
wget https://aka.ms/vs/17/release/vs_BuildTools.exe -OutFile vs_BuildTools.exe
.\vs_BuildTools.exe --passive --add "Microsoft.VisualStudio.Workload.VCTools;includeRecommended;includeOptional"
# Download and install Python 3.11.0
wget https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe -OutFile python-3.11.0-amd64.exe -UseBasicParsing
.\python-3.11.0-amd64.exe /passive InstallAllUsers=1 PrependPath=1
# Clone repo and install requirements
wget https://github.com/cpAdm/Pyternity/archive/refs/heads/master.zip -OutFile pyternity.zip
Expand-Archive pyternity.zip
cd pyternity\Pyternity-master
pip install .

Any other OS:

  1. Install Python 3.11.0 (other versions may not work properly)
  2. Clone this repository
  3. Install dependencies: pip install . (or for development: pip install -e .)

Using Pyternity

Note: For security reasons, only use this tool on trusted PyPI projects.

>>> .\pyternity\main.py -h

usage: main.py [-h] (--most-popular-projects MOST_POPULAR_PROJECTS | --biggest-projects BIGGEST_PROJECTS | --projects PROJECTS [PROJECTS ...])
               [--max-release-date MAX_RELEASE_DATE] [--most-popular-projects-hash MOST_POPULAR_PROJECTS_HASH] [--release-type {major,minor}]
               [--re-download-projects] [--re-calculate-features]

Calculate modernity signatures for PyPI projects

options:
  -h, --help            show this help message and exit
  --most-popular-projects MOST_POPULAR_PROJECTS
                        Calculate the signature for the given amount of most popular PyPI projects
  --biggest-projects BIGGEST_PROJECTS
                        Calculate the signature for the given amount of biggest (in size) PyPI projects
  --projects PROJECTS [PROJECTS ...]
                        Calculate signature for specific PyPI projects
  --max-release-date MAX_RELEASE_DATE
                        Maximum date (in ISO 8601 format) any release of any project can have, e.g. 2023-01-31
  --most-popular-projects-hash MOST_POPULAR_PROJECTS_HASH
                        Hash of the top-pypi-packages to use (default: 'main')
  --release-type {major,minor}
                        Calculate the signature for given type of releases of the projects (leave out to calculate for all releases)
  --re-download-projects
                        With this flag, all projects are always re-downloaded
  --re-calculate-features
                        With this flag, ignore the 'results' folder and instead process the PyPI files

Reproduce Research

Re-calculate the signatures:

.\pyternity\main.py --most-popular-projects 50 --release-type minor --max-release-date 2022-12-31 --most-popular-projects-hash fa998b797a5300a240e2b4c042f9a438ab91c7f5 --re-calculate-features

Intermediate results of this can be found in results folder. All plots can be found in plots folder, including All Projects.svg:

All project plot

To validate Vermin run its test, this will also generate plots/Vermin Validation.svg:

python -m unittest tests.vermin_test.TestFeatures.test_from_changelog

modernity-python's People

Contributors

cpadm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.