Package: arca
ArcaArca is a library for running Python functions (callables) from git repositories in various states of isolation.
Arca can also cache the results of these callables usingdogpile.cache.Getting startedGlossaryArca- name of the library. When written asArca, the main interface class is being referenced.Task- definition of the function (callable), consists of a reference to the object and arguments.Backend- a way of running tasks.InstallationRequirementsPython >= 3.6Requirements for certain backends:Pipenv(for certain usecases inVirtualenv Backend)Docker(forDocker BackendandVagrant Backend)Vagrant(for theVagrant Backend)InstallationTo install the last stable version:python-mpipinstallarcaIf you want to use the Docker backend:python-mpipinstallarca[docker]Or if you want to use the Vagrant backend:python-mpipinstallarca[vagrant]Or if you wish to install the upstream version:python-mpipinstallgit+https://github.com/pyvec/arca.git#egg=arcapython-mpipinstallgit+https://github.com/pyvec/arca.git#egg=arca[docker]python-mpipinstallgit+https://github.com/pyvec/arca.git#egg=arca[vagrant]ExampleTo run a Hello World example you’ll only need thearca.Arcaandarca.Taskclasses.Taskis used for defining the task that’s supposed to be run in the repositories.Arcatakes care of all the settings and provides the basic API for running the tasks.Let’s say we have the following file, calledhello_world.py,
in a repositoryhttps://example.com/hello_word.git, on branchmaster.defsay_hello():return"Hello World!"To call the function using Arca, the following example would do so:fromarcaimportArca,Tasktask=Task("hello_world:say_hello")arca=Arca()result=arca.run("https://example.com/hello_word.git","master",task)print(result.output)The code would printHello World!.resultwould be aarca.Resultinstance.arca.Resulthas three attributes,outputwith the return value of the function call,stdoutandstderrcontain things printed to the standard outputs
(see the section aboutResultfor more info about the capture of the standard outputs).
If the task fails,arca.exceptions.BuildErrorwould be raised.By default, theCurrent Environment Backendis used to run tasks,
which uses the current Python, launching the code in a subprocess. You can learn about backendshere.Further readingYou can read the full documentation onRead The Docs.Running testsTo run tests you’ll need the optional requirements, Docker and Vagrant. Once you have them and they can be used by
the current user you just need to run:pythonsetup.pytestThis will launch the tests and a PEP8 check. The tests will take some time since building the custom
docker images is also tested and vagrant, in general, takes a long time to set up.ContributingContributions are welcomed! Feel free to open a issue or submit a pull request onGitHub!Changes0.3.3 (2019-12-10)Changes:Updated dependenciesAllowed branches with slashes  (#79)0.3.2 (2019-11-23)Changes:Moved the project under organisation Pyvec.Changed the Docker registry for the base images toarcaoss/arca.Fixed unicode paths to repositories (#60)0.3.1 (2018-11-16)Raising a Arca exception when building of a Docker image fails. (#56,#57)0.3.0 (2018-08-25)Changes:Removed CurrentEnvironmentBackend’s capability to process requirements - all requirements are ignored. (BACKWARDS INCOMPATIBLE)Added support for installing requirements usingPipenv.
The directory containingPipfileandPipfile.lockis set by the backend optionpipfile_location, by default the root of the repository is selected.
The Pipenv files take precedence over regular requirement files.TheResultclass now has two more attributes,stdoutandstderrwith the outputs of launched tasks to standard output and error.
Priting is therefore now allowed in the endpoints.Using UTF-8 locale in Docker images used inDockerBackend.Supporting Python 3.7.0.2.1 (2018-06-11)Updated dogpile.cache to 0.6.5, enabling compatability with Python 3.7.
Updated the Docker backend to be able to run on Python betas.0.2.0 (2018-05-09)This release has multiple backwards incompatible changes against the previous release.Changes:Using extras to install Docker and Vagrant dependenciespip install arca[docker]orpip install arca[vagrant]has to be usedAutomatically using cloned repositories as reference for newly cloned branchesUsing Debian as the default base image in the Docker backend:apk_dependencieschanged toapt_dependencies, now installing usingapt-getVagrant backend only creates one VM, instead of multiple – see its documentationAdded timeout to tasks, 5 seconds by default. Can be set using the argumenttimeoutforTask.Added timeout to installing requirements, 300 seconds by default. Can be set using therequirements_timeoutconfiguration option for backends.0.1.1 (2018-04-23)Updated gitpython to 2.1.90.1.0 (2018-04-18)Initial releaseChanges:Updated PyPI description and metadata0.1.0a0 (2018-04-13)Initial alfa release