Package: versionoverlord
RationaleThese utilities are meant to solve a problem with related repositories and their dependency relationshipsProjects may have hierarchical dependencies.  See the followingPyutdependency diagram.---
title: Pyut Dependency Graph
---
flowchart
	direction LR
	
  pyut(Pyut 7.7.0) --> oglio(oglio 0.5.80)
  pyut(Pyut 7.7.0) --> pyutplugins(pyutplugins 0.8.40)
  
  pyutplugins(pyutplugins 0.8.40) -.-> oglio(oglio 0.5.80)
  pyutplugins(pyutplugins 0.8.40) & oglio(oglio 0.5.80) --> untanglepyut.0.6.40

   pyut(Pyut 7.7.0) & oglio(oglio 0.5.80) & untanglepyut.0.6.40 --> ogl.0.70.20
   
   pyut(Pyut 7.7.0) &  pyutplugins(pyutplugins 0.8.40) &  oglio(oglio 0.5.80) &  untanglepyut.0.6.40 &  ogl.0.70.20 -...-> pyutmodel.1.4.2
   pyut(Pyut 7.7.0) & pyutplugins(pyutplugins 0.8.40) & ogl.0.70.20 ----> hasiicommon.0.2.0

    style pyut fill:#ee4,stroke:#333,stroke-width:
    %% linkStyle 1 stroke:#ff3,stroke-width:4px,color:red;The above diagram illustrates how low level dependencies ripple up the dependency tree.Dependency LocationsAdditionally, projects may specify dependencies in different places.  Examples of the dependency locations aresetup.pyrequirements.txt.circleci/config.yml.travis.ymlPython Console ScriptsVersionOverlord means to handle this problem by providing a set of Python command line scripts to automate updating the first three of the above dependency specification locationsquerySlugs                    -- queries repositories for their latest release versioncreateSpecification      -- creates a dependency specification for a projectupdateDependencies  -- updates the supported dependency locations using the generated specificationRequired Environment VariablesThe above commands depend on the following environment variables.GITHUB_ACCESS_TOKEN-ApersonalGitHubaccesstokennecessarytoreadrepositoryreleaseinformation
PROJECTS_BASE-Thelocaldirectorywherethepythonprojectsarebased
PROJECT-Thenameoftheproject;ItshouldbeadirectorynameSee theGitHub Documentationfor instructions on how to create a usable access token.  These scripts assume  that a developer keeps all checked out repositories in a single directory.  An example, of a PROJECTS_BASE is:exportPROJECTS_BASE="${HOME}/PycharmProjects"This should be set in your shell startup script.  For example.bash_profile.The PROJECT environment variable should be set on a project by project basis.  I recommend you usedirenvto manage these.  An example of a .envrc follows:exportPROJECT=pyutmodelsourcepyenv-3.10.6/bin/activateAdvanced SlugsThe command line options for querySlug and createSpec are advanced GitHub slugs.  For example, for the following repositorieshttps://github.com/hasii2011/pyutmodelhttps://github.com/hasii2011/hasiicommonhttps://github.com/hasii2011/code-ally-basicThe slugs arehasii2011/pyutmodelandhasii2011/hasiicommonandhasii2011-code-ally-basic,codeallybasic, respectively.  Note the advanced part of the third slugs because the package name does not match the repository name;UsageFrom the above dependency diagram assume the following:Both thepyutmodelandhasiicommonrepositories have been updated.  We need to update theogldependencies to match the latest of both.  Assume bothGITHUB_ACCESS_TOKENandPROJECTS_BASEare correctly set andPROJECTis set to'ogl'.  Use the following CLI invocation to create the specification file.createSpecification -s hasii2011/pyutmodel -s hasii2011/hasiicommonThe command creates the fileversionSpecification.csvwith the following contents.PackageName,OldVersion,NewVersion
pyutmodel,1.4.0,1.4.1
hasiicommon,0.0.7,0.1.0Again assuming the previously mentioned environment variables are set the following CLI invocation;updateDependenciescorrectly updates the followingsetup.pyrequirements.txt.circleci/config.ymlInstallationpip install versionoverlordWritten byHumberto A. Sanchez II(C) 2023NoteFor all kind of problems, requests, enhancements, bug reports, etc.,
please drop me an e-mail.I am concerned about GitHub's Copilot projectI urge you to read about theGive up GitHubcampaign fromthe Software Freedom Conservancy.While I do not advocate for all the issues listed there I do not like that
a company like Microsoft may profit from open source projects.I continue to use GitHub because it offers the services I need for free.  But, I continue
to monitor their terms of service.Any use of this project's code by GitHub Copilot, past or present, is done
without my permission.  I do not consent to GitHub's use of this project's
code in Copilot.