Skip to main content

requires42.com cli

Project description

Installation

$ [sudo] pip install requires42

Examples

$ export REQUIRES42_TOKEN=XXX # https://requires42.com/token/
$ requires42 . > requirements.txt
$ requires42 . | awk -F '=' '{print $1}' > requirements.txt # without versions

curl api:

set -- curl -s -X POST -H "Authorization: Token $REQUIRES42_TOKEN"
files="$(find "$PWD" -type f -not -path "$PWD/tests/*" -name "*.py" -type f)"
[[ -n "$files" ]] && while IFS= read f; do
    set -- "$@" -F "file[]=@$f"
done <<< "$files"
set -- "$@" https://api.requires42.com/requires
"$@" . > requirements.txt

python api:

import requests

url = 'https://api.requires42.com/requires'
headers = {'Authorization': 'Token REQUIRES42_TOKEN'}

files = {
    'package/__init__.py': open('package/__init__.py','rb'),
    'package/base.py': open('package/base.py','rb')
}
r = requests.post(url,headers=headers,files=files)
open('requirements.txt','w').write(r.text)

Links

readme42.com

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

requires42-2020.12.3.tar.gz (1.9 kB view hashes)

Uploaded Source

Supported by

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