Skip to content

Getting started

James Knight edited this page May 15, 2024 · 1 revision

Installing

  1. It is recommended to install using pipx. If not already installed, follow the installation instructions for pipx. Although, users are free to install fetchdep from PyPA as they would other packages.
  2. Install this utility using the following command:
    pipx install fetchdep
    
  3. Verify the package is installed by running the command:
    fetchdep --version
    
    If the above command is not available for the running context, the following command can be used:
    python -m fetchdep --version
    

Using

If looking to support fetchdep fetching dependencies for a project, perform the following steps:

  1. At the root of a repository, create an empty file named fetchdep.yml.
  2. Using a text editor, add the following to the file:
    fetchdep:
      - name: myname1
        site: mysite1
    
  3. Replace the value (myname1) for a name entry with the expected directory name for the dependency. For example, if the expected dependency is to be checked out into a folder my-awesome-lib, the following should be set:
    fetchdep:
      - name: my-awesome-lib
        site: mysite1
    
  4. Next, replace the value (mysite1) for a site entry with the expected clone/checkout site for the dependency. For example, if looking to clone a Git repository [email protected]:my-awesome-name/my-awesome-lib.git, the following should be set (see other VCS type examples):
    fetchdep:
      - name: my-awesome-lib
        site: [email protected]:my-awesome-name/my-awesome-lib.git
    
  5. Save the file.
  6. Run fetchdep (or python -m fetchdep) to fetch the dependency for the project.

After verifying the configured dependency can fetch as expected, additional dependencies (if any) can be added to the configuration file. For example, the following shows two dependency entries:

fetchdep:
  - name: my-awesome-lib
    site: [email protected]:my-awesome-name/my-awesome-lib.git
  - name: another-lib
    site: svn+https://svn.code.example.com/c/myteam/another-lib/trunk

A user can invoke fetchdep multiple times. Only missing dependencies will be fetched.

Clone this wiki locally