Saravanan666/pypi-org huggingface dataset:
Package: requirements-tests
requirements.txtThis is a safeguard against typos when runningpip install-rrequirements-dev.txt. If you leave out the-rby
accident, this package will cause your installation to abort.$ pip install requirements-dev.txt
Collecting requirements-dev.txt
Installing collected packages: requirements-dev.txt
  Running setup.py install for requirements-dev.txt ... error
    Complete output from command:
    running install
    It looks like you meant to type `pip install -r requirements-dev.txt`,
    but you left out the `-r` by accident. Aborting installation.Why?If we had no such package on PyPI, you could accidentally install a
package installed with the name of your requirements file. A malicious
user could register a package that would mimic proper installation
process and also launch anny arbitrary code.PyPI (fortunately) does not allowrequirements.txtas a package
name, so that case is handled already. All forbidden package names that
arehardcoded in PyPI source
codeare:requirements.txtrrequirements.txtrequirements-txtrrequirements-txtBut it obviously does not cover all popular cases. This is why this
sources are distributed on PyPI under few popular names that are not
forbidden by PyPI:requirements-dev.txtrequirements-devrequirements-test.txtrequirements-testDid it ever happen?Yeah. Typo squatting happens on PyPI from time to time. This project is
the best example of that. Previous version ofrequirements.txtactually did something more than aborting its installation. It provided
a specially craftedsetup.pyscript that could:look on your filesystem to find a requirements file you intended to
installinstall all packages in another pip subprocessdisplay output that would mimick normal installation processNewer versions of pip completely swallow all output of package
installation script but thih behavior can be easily bypassed - at least
on OS X and Linux. Also runtime version switch (to0.0.0) allowed to
install this package over and over becasue there was always newer
version available on PyPI. If something went wrong (especially on
Windows) it resulted in crypting and rude error message.Nothing harmful. Actually useful sometimes. At least in my personal
opinion. Anyway my sense of usability and humourwas contested by some
people. This is
whyrequirements.txtwill longer install other packages and always
exit with error code during installation. This is mostly thanks to
pull-request from @aanand andhis
points. I may not
agree with all of them but I respect people’s PRs.Nevertheless, some additional messages may be displayed during
installation attempt. You know… It was made for fun.If you are interested in hacks included in previous version of this
package refer tocontested-sense-of-humourbranch orend-of-funtag in this project’srepository.
Package: requirements-test.txt
requirements.txtThis is a safeguard against typos when runningpip install-rrequirements-dev.txt. If you leave out the-rby
accident, this package will cause your installation to abort.$ pip install requirements-dev.txt
Collecting requirements-dev.txt
Installing collected packages: requirements-dev.txt
  Running setup.py install for requirements-dev.txt ... error
    Complete output from command:
    running install
    It looks like you meant to type `pip install -r requirements-dev.txt`,
    but you left out the `-r` by accident. Aborting installation.Why?If we had no such package on PyPI, you could accidentally install a
package installed with the name of your requirements file. A malicious
user could register a package that would mimic proper installation
process and also launch anny arbitrary code.PyPI (fortunately) does not allowrequirements.txtas a package
name, so that case is handled already. All forbidden package names that
arehardcoded in PyPI source
codeare:requirements.txtrrequirements.txtrequirements-txtrrequirements-txtBut it obviously does not cover all popular cases. This is why this
sources are distributed on PyPI under few popular names that are not
forbidden by PyPI:requirements-dev.txtrequirements-devrequirements-test.txtrequirements-testDid it ever happen?Yeah. Typo squatting happens on PyPI from time to time. This project is
the best example of that. Previous version ofrequirements.txtactually did something more than aborting its installation. It provided
a specially craftedsetup.pyscript that could:look on your filesystem to find a requirements file you intended to
installinstall all packages in another pip subprocessdisplay output that would mimick normal installation processNewer versions of pip completely swallow all output of package
installation script but thih behavior can be easily bypassed - at least
on OS X and Linux. Also runtime version switch (to0.0.0) allowed to
install this package over and over becasue there was always newer
version available on PyPI. If something went wrong (especially on
Windows) it resulted in crypting and rude error message.Nothing harmful. Actually useful sometimes. At least in my personal
opinion. Anyway my sense of usability and humourwas contested by some
people. This is
whyrequirements.txtwill longer install other packages and always
exit with error code during installation. This is mostly thanks to
pull-request from @aanand andhis
points. I may not
agree with all of them but I respect people’s PRs.Nevertheless, some additional messages may be displayed during
installation attempt. You know… It was made for fun.If you are interested in hacks included in previous version of this
package refer tocontested-sense-of-humourbranch orend-of-funtag in this project’srepository.
Package: requirements-wayback-machine
Requirements.txt Wayback Machine 🚂🕒️Note: This is script is not developed nor endorsed by thePython Packaging Authority (PyPA)or other official Python body.If you're struggling to get correct Python dependencies for an older project,requirements_wayback_machineis a script that gets you from thisrequirements.txt:torch
torchvision
imageioto this:# requirements_wayback_machine: reference date 2021-02-03
# requirements_wayback_machine: torch<=1.7.1
torch
# requirements_wayback_machine: torchvision<=0.8.2
torchvision
# requirements_wayback_machine: imageio<=2.9.0
imageioInstallation$pipinstallrequirements-wayback-machineUsage$requirements_wayback_machine-r<path_to_requirements.txt>-d<YYYY-MM-DD>This will print annotatedrequirements.txtto console, including upper bound
specifiers that approximate dependency resolution at given date
(for each requirement line, we print the last version of that dependency
released by given date that also satisfies specifiers already present
in the input requirement line, if any).For more information and options, runrequirements_wayback_machine -h.Example:$requirements_wayback_machine-rrequirements.txt-d2021-02-03# requirements_wayback_machine: reference date 2021-02-03# requirements_wayback_machine: torch<=1.7.1torch# requirements_wayback_machine: torchvision<=0.8.2torchvision# requirements_wayback_machine: imageio<=2.9.0imageioLicenseMIT - seeLICENSE.txt.
Package: require-package
python-require: Provides one-time installation of Python packagepython-require allows for one-time installation of a Python package. It is particularly useful for prototyping, where you need to quickly install a package and use it in your code but you don't want to bloat your environment. Inspired by npx and pipxIt's worth noting that packages installed by python-require are automatically deleted after the script finishes running. This means that the package will not persist in your development environment, and will need to be re-installed the next time you run your script. This behavior is intentional, as it helps prevent conflicts between different versions of packages that may be installed in your environment.Installationpipinstallrequire-packageUsagefromrequire_packageimportrequire# Install a packagerequests=require("requests")r=requests.get("https://google.com")print(r.status_code)Caveatspython-require is not a package manager. It is a tool for prototyping. It is not meant to be used in production.
Additionally, Python-Require may not work properly in all environments. In particular, it may have trouble installing packages in virtual environments with non-standard configurations. Use at your own risk!LicenseMIT License
Package: requirepy
require.pyA way to manage dependency conflicts.What Is require.py?The core of require.py is a hack of the Python import statement. By default,
all Python modules are installed at the global, site-packages level. This
makes it difficult, and sometimes impossible, to install libraries with
conflicting dependency requirements. To a large extent, virtual environments
have solved this problem by providing sandboxes in which Python modules can
be installed without affecting other virtual environments. Even virtualenvs,
however, do not allow a single Python process to load multiple, conflicting
versions of a dependency as the same time.This project provides tools for managing dependencies at a Python package
level. This means each Python package (a directory containing an__init__.py) can have a unique version of a dependency that is isolated from
the other packages around it.Import BehaviourThe import logic, and name for this project, are heavily inspired by the
node.js module and import system. The relevant behaviour in node is documentedhere.This package exposes a callable namedrequirethat can be used to provide the
alternate import logic. Alternatively, there arepatch_importandunpatch_importavailable to affect an entire Python process. Here is a
scenario to illustrate the import logic. Given the following project structure:/myproject/__init__.py
/myproject/subpackage/__init__.py
/myproject/subpackage/subsubpackage/__init__.pyWhere the__init__.pyof subsubpackage has the following content:fromrequireimportrequirerequests=require('requests')The custom import logic will first look for a ‘.pymodules’ directory in
subsubpackage. If found, it will attempt to import requests from that
directory. If not found, it will continue walking the file system upwards
until it hits ‘/’. After hitting the root, if no ‘.pymodules’ directories are
found the function falls back to the default Python import logic.Package ManagementKeep using pip. This project includes a helper command calledrequirepythat
can be used to help install dependencies into the right subdirectories. It
wraps pip.LicenseCopyright 2014 Kevin Conway

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.ContributingAll contributions to this project are protected under the agreement found in
theCONTRIBUTINGfile. All contributors should read the agreement but, as
a summary:You give us the rights to maintain and distribute your code and we promise
to maintain an open source distribution of anything you contribute.
Package: require-python-3
require-python-3 contains this code:if sys.version_info[0] != 3:
    print("This script requires Python 3")
    exit()How to useInstall packageEither:Addrequire-python-3to yourrequirements.txtfile and runpip3 install-rrequirements.txtOr run directly:pip3 installrequire-python-3Or downloadrequire_python_3.pydirectly and put it next to your script sourcesInclude moduleAddimport require_python_3to your scripts that require python 3.
Package: requires
requiresInstall:pip install requiresDecorate that lets you
Require/Import dependencies at runtime.Python dependency management can be mind bottlingly complex. Optional dependencies are pretty common. Why not require the dependency at run time if a function requires said dependency?This package has come in handy in lambda-land where you only get 250mb (on aws)!Usage:# This will faildefuno():returnjson.dumps({"a":1,"b":2})try:uno()exceptNameErrorasne:print("Error:",ne)Error: name 'json' is not defined# This will not failimportrequires# Module is callable! (checkout funkify for more info -- `pip install funkify`)@requires("json")defuno():returnjson.dumps({"a":1,"b":2})uno()'{"a": 1, "b": 2}'importrequires@requires("from json import dumps")defuno():returndumps({"a":1,"b":2})uno()'{"a": 1, "b": 2}'defdos():returndumps({"a":1,"b":2})dos()'{"a": 1, "b": 2}'importrequires@requires(_from="json",_import="dumps")defdos():returndumps({"a":1,"b":2})dos()'{"a": 1, "b": 2}'importrequires@requires(_import="rapidjson",pip="python-rapidjson",conda_forge="python-rapidjson")deftres():returnrapidjson.dumps({"a":1,"b":2})tres()# Will err if not install with where to install instructions'{"a":1,"b":2}'# should errordefquatro():returnpath.join("a","b")try:quatro()exceptNameErrorasne:print("ERROR:",ne)ERROR: name 'path' is not definedfromrequiresimportRequirementos_path_req=Requirement(_import="path",_from="os")@os_path_reqdefquatro():returnpath.join("a","b")assertisinstance(quatro(),str)Enforcing requirementsimportrequirestry:importalibraryexceptModuleNotFoundError:requirement=requires.Requirement(_import="alibrary",pip=True,conda_forge="alibrary-conda-listing",details="Install details",)try:requirement.raise_error()exceptrequires.RequirementErroraserr:print("ERROR:")print(err)ERROR:
Module/Package(s) not found/installed; could not import: `import alibrary`
    pip install alibrary
    conda install -c conda-forge alibrary-conda-listing
    Install detailsLess verbose version:importrequirestry:importalibraryexceptModuleNotFoundError:requires.Requirement(_import='alibrary',pip=True,conda_forge='alibrary-conda-listing',details="Install details").raise_error()Future ideas?Adding support for requiring particular package versions?Auto install?Allow non pip/conda/conda-forge locations?
Package: requires42
Installation$[sudo]pipinstallrequires42Examples$exportREQUIRES42_TOKEN=XXX# https://requires42.com/token/$requires42.>requirements.txt
$requires42.|awk-F'=''{print $1}'>requirements.txt# without versionscurl api:set--curl-s-XPOST-H"Authorization: Token$REQUIRES42_TOKEN"files="$(find"$PWD"-typef-not-path"$PWD/tests/*"-name"*.py"-typef)"[[-n"$files"]]&&whileIFS=readf;doset--"$@"-F"file[]=@$f"done<<<"$files"set--"$@"https://api.requires42.com/requires"$@".>requirements.txtpython api:importrequestsurl='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)Linksrequires42.comreadme42.com
Package: requires.io
InstallationTo install, simply:$pipinstallrequires.ioUsageCreate or update a repository:$requires.ioupdate-repo-tMY_TOKEN-rMY_REPO(--public|--private)Create or update a branch:$requires.ioupdate-branch-tMY_TOKEN-rMY_REPO-nMY_BRANCH/path/to/my/sourcesCreate or update a tag:$requires.ioupdate-tag-tMY_TOKEN-rMY_REPO-nMY_TAG/path/to/my/sourcesMonitor a site:freeze the current environment with piphostname is the default site name$requires.ioupdate-site-tMY_TOKEN-rMY_REPODelete repositories, branches, tags and sites:$requires.iodelete-repo-tMY_TOKEN-rMY_REPO$requires.iodelete-branch-tMY_TOKEN-rMY_REPO-nMY_BRANCH$requires.iodelete-tag-tMY_TOKEN-rMY_REPO-nMY_TAG$requires.iodelete-site-tMY_TOKEN-rMY_REPO-nMY_SITEChangelog0.2.6BugfixesDisplay help whenrequires.iocalled without argument0.2.5FeaturesAddparsecommand line to parse a single requirements file0.2.4BugfixesKeep detected path patterns when computing the remote basename of a requirement file0.2.3BugfixesEncoding issue in Python 3 for commandsupdate-branchandupdate-tag
Package: requisitor
requisitorSimple HTTP library utilizing only Python stdlibExamples>>>r=requisitor.get('http://httpbin.org/basic-auth/user/pass',auth=('user','pass'))>>>r.headers['content-type']'application/json'>>>r.text'{\n  "authenticated": true, \n  "user": "user"\n}\n'>>>r.json(){'authenticated': True, 'user': 'user'}>>>
Package: req-update
req-updatereq-updateis a CLI tool to automatically update python, go, node, and git submodule dependencies.Usagereq-updaterequires no command line arguments.  Runningreq-updatewill
create a branchdep-update, check for outdated packages, and commit a
series of commits to update packages.$ req_update
usage: req_update.py [-h] [-l LANGUAGE] [-p] [-d] [-v] [--version]

Update python, go, node, and git submodule dependencies for your project with git integration

https://github.com/albertyw/req-update

options:
  -h, --help            show this help message and exit
  -l LANGUAGE, --language LANGUAGE
                        Language/package manager to update.  Options are: gitsubmodule, go, node, python
  -p, --push            Push commits individually to remote origin
  -d, --dryrun          Dry run
  -v, --verbose         Verbose output
  --version             show program's version number and exitFeaturesUpdate python dependencies inrequirements*.txtpip.Update go dependencies ingo.modandgo.sumwith go modules.Update node dependencies inpackage-lock.jsonwith npm.Update git submodules in.gitmoduleswith git.Integrates with git, creating a branch with one commit per updated dependencyNo third party dependencies beyond python 3 standard libraryAutomatic detection of python, go, node, and git dependencies; no CLI arguments requiredComparisonsreq-upgrader-req-updateintegrates with git
Package: requre
REQUest REcordingRequre [rekure]Is a library for storing output of various function and methods to
persistent storage and be able to replay the stored output to functions
backDocumentationPlan and current statusUsed for testingpackit-serviceorganization projectsogrpackitInstallationOn Fedora:$ dnf install python3-requreOr from PyPI:$ pip3 install --user requreYou can also installrequrefrommainbranch, if you are brave enough:You can use ourpackit/packit-devCopr repository:$ dnf copr enable packit/packit-dev
$ dnf install python3-requreOr$ pip3 install --user git+https://github.com/packit/requre.git
Package: requtests
RequtestsTest helpers for therequestslibraryInstallationInstall the packagerequtestsversion1.0+from PyPI.
The recommendedrequirements.txtline isrequtests~=1.0.FakeAdapterCreates an adapter intended for use withrequest.Session.
Returns the passedResponseinstance when the adapter'ssendmethod is called. If theassertionsfunction has been specified, it will be called with the request before returning the response.The faked adapter can be mounted using the standardmountmethod on an instance ofSessionwith a suitable URL prefix. Use multiple faked adapters, specifically mounted for some URL:s, to simulate a chain of requests and responses being made.ExamplefromrequtestsimportFakeAdapter,fake_responsefromrequestsimportSessionclassClient:def__init__(self):self.session=Session()defcreate_user(self,username):returnself.session.post("https://example.com/users",params={"action":"create"},json={"username":username},headers={"Authorization":"Bearer token"},)deftest_create_user():user_created_response=fake_response(json={"message":"User created!"},status_code=201)adapter=FakeAdapter(user_created_response,assertions=_create_user_assertions)prefix="https://example.com/users"client=Client()client.session.mount(prefix,adapter)actual_response=client.create_user("my_username")assertactual_response.status_code==201assertactual_response.json()=={"message":"User created!"}def_create_user_assertions(prepared_request,**kwargs):assertprepared_request.method=="POST"assertprepared_request.url=="https://example.com/users?action=create"assertprepared_request.headers["Authorization"]=="Bearer token"assertprepared_request.body==b'{"username": "my_username"}'fake_requestReturns a function behaving asrequests.request, except that it returns a different response each time it is called. Useful to test e.g. pagination.fake_request_with_responseSimilar tofake_request, except that it instantiates a singleResponseobject and returns it based on its arguments.Exampleimportrequestsfromrequtestsimportfake_request_with_responsedeflogin(username,password,request_func=requests.request):response=request_func("POST","https://example.com/login",data={"username":username,"password":password})response.raise_for_status()returnresponse.json()["token"]deftest_login():username="my-username"password="my-password"request_func=fake_request_with_response(json={"token":"my-login-token"})assertlogin(username,password,request_func=request_func)=="my-login-token"fake_responseReturns arequests.Responseobject with either the return value of itsjson()method set to a python data structure or itstextproperty set.
Package: reqwire
reqwirewires up your pip requirements withpip-tools.Install>FromPyPI:$ pip install -U reqwire>Fromsource:$ pip install -e git+https://github.com/darvid/reqwire.git#egg=reqwireFeaturesManage multiple requirement source files, ortagsAdd requirements from the command line (à lanpm--save)Compile tagged source files withpip-compile(frompip-tools)RationaleUntilPEP 518andPipfilebecome reality, maintaining one or morerequirements.txtfiles for Python projects will continue to be
subject to personal preference and differing opinions on best practices[1]. Typical workflows involve maintaining multiplerequirements.txtfiles, and many projects have some form of tooling,
be it Makefile targets or external tools, such as Vincent Driessen’s
excellentpip-tools.reqwireis a glorified wrapper around pip-tools, and imposes a
slightly opinionated workflow:Python requirements are split intosource filesandbuilt files,
with the built files being the output frompip-compile, containing
pinned versions of the entire dependency graph. (Usereqwire initto quickly scaffold the necessary directory structure.)Source files(with the.inextension) represent a project’s
immediate dependencies, and are always pinned to specific versions or
version ranges.Source filenames are synonymous withtags, which can be passed toreqwire addandreqwire buildto maintain requirements for
entirely separate environments.Disclaimerreqwiremakes no claims about being designed specifically for
humans, bonobos, cats, or any other land mammal. This project isnotfarm raised, free range, organic, low sugar, MSG free, gluten free,
halal, kosher, vegan, or particularly of any nutritional value
whatsoever. It just wrapspip-toolsand helps you manage your freakin
Python requirements. ☮ 🌈LinksSource codeDocumentationRoadmapUnit testsProvide a command to update requirements (user-specified version)Provide a command to freshen requirementsProvide a command to combine tags to a single output file
(easily possible withpip-compile)Provide a utility for generating setup and runtime requirements in
setup.py scripts using setuptools.Abandon in favor ofPipfile👌[1]http://nvie.com/posts/pin-your-packages/https://www.kennethreitz.org/essays/a-better-pip-workflowhttps://mail.python.org/pipermail/distutils-sig/2015-December/027954.htmlhttps://devcenter.heroku.com/articles/python-pip#best-practices