Package: rqmts
RqmtsRqmts - Generate requirements.txt file for any project by analysing package importsClickhereto see the demo.Clickherefor documentation.About the projectRqmtsis a fantastic stand-alone tool which generatesrequirements.txtfile for any project by analysing package imports.It does not requires any dependency (works out-of-the-box), not needs internet to work(is completely offline, upto this moment), nor uses regular expressions in such a violent way as existing projects do. Instead, it uses simple heuristic techniques and parse conditional trees, which is a better method for extracting imported names from statements, functions, etc.Why this projectQuestionsWhy not just use pip's freeze commandto generate arequirements.txtfile for my project?Why tore-invent the wheelwhen there are modules such aspipreqs,pigar,poetryalready present?Why not manually?AnswersWhy not just pip freeze?pip freezeonly saves the packages that are installed withpip installin your environment.pip freezesaves all packages in the environment including those that you don't use in your current project.(if you don't have virtualenv)Whyre-invent the wheel(?)pipreqsfails on many occasions(see -pipreqs/issues)pigarqueries pypi servers, big no-no. Ideally, it should be local, on fallback? then maybe. Other than that,pigarrecommends using Pipenv (pipenv has serious issues)poetryquotes "Be aware, however, that it will also install poetry's dependencies which might cause conflicts."Sheer curiousity."can I create a project that has potential of collecting thosands of stars and most importantly, hundreds of contributors?"Manually?Are you serious right now?InstallationUsepipto installrqmts. This is therecommended way of running Rqmts.Rqmtsalso provides a script that will run arqmts instanceisolated from the rest of your system by using file-less/memory-based execution.curl -sSL https://raw.githubusercontent.com/0x48piraj/rqmts/master/Rqmts.py | pythonAlternatively, you can downloadRqmts.pyfrom the root directory and execute it separately.UsageCommand-line Interface and Interactive modeChallengesThe major challenge of this project is to extract the required metadata from modules which are first extracted from the input script.Version numbers in python can be in very different places depending on the casePackage name in the package index is independent of the module name we importand these quirks make this project interesting. There's a funny comment in the source which reflects the diversity between us and it goes like :# module_name.__version__ sucks, because we suck (PEP 0396)This project aims to combine the best existing strategies to cover the broadest possible set of cases(if not all). The project was built keeping in mind the modular programming paradigms and so other than being readable it's easily extensible making it possible to add new strategies/algorithms quickly.ChangelogPlaying with different versions? Read theChangelog.ContributeAll patches are Welcome! Please seeCONTRIBUTING.mdfor further details. For discussions, create anew issueor ping me overTwitterAgain, if you have any issues or suggestions/patches, please do not hesitate toopen an issueor apull request!Running the testsThis project usesunittest.The Python unit testing framework, sometimes referred to as "PyUnit," is a Python language version of JUnit, by Kent Beck and Erich Gamma. JUnit is, in turn, a Java version of Kentâ€™s Smalltalk testing framework. Each is the de facto standard unit testing framework for its respective language.You may need to install the package (rqmts) for setup beforehand, usingpip install --user rqmtsAll tests are encapsulated in one single script namedtestsuite.pyand all the respective test-cases are undertests/testcases/For getting started,python tests/testsuite.pyLicenseThis software is licensed underBSD 3-Clause "New" or "Revised" License. To view a copy of this license, visitBSD 3-Clause.