Skip to content

Instantly share code, notes, and snippets.

@entelecheia
Last active April 23, 2024 19:01
Show Gist options
  • Save entelecheia/2f7edab56000c345fcf142605d894416 to your computer and use it in GitHub Desktop.
Save entelecheia/2f7edab56000c345fcf142605d894416 to your computer and use it in GitHub Desktop.
hyfi-template-issue

Initialize Repository with HyFI-Template.

Assignees: Labels: Milestone: Projects:

Description

To streamline the development process and ensure a solid foundation for our Python projects, we will initialize our repositories using the HyFI-Template. HyFI-Template is a ready-to-use GitHub template repository that leverages the power of the Hydra configuration system and the Pydantic data validation library, providing a comprehensive set of tools to create flexible and adaptable interfaces for various Python applications. By utilizing the .envrc file provided by the template, we can quickly set up a virtual environment and start building our projects with the HyFI framework.

Requirements

  1. Set up the repository:

    • Create a new repository on GitHub for the project, choosing a descriptive and concise name.
    • Clone the newly created repository to your local development environment.
  2. Inject the HyFI-Template:

    • From the root of the cloned repository, run the following command to inject the HyFI-Template:
      copier copy --trust --data 'code_template_source=gh:entelecheia/hyfi-template' --answers-file .copier-config.yaml gh:entelecheia/hyperfast-python-template .
      
    • Follow the prompts and provide the necessary information to configure the template for the project.
  3. Set up the development environment using .envrc:

    • Ensure that you have direnv installed on your system. If not, install it using the appropriate package manager for your operating system.
    • Allow direnv to manage the environment by running: direnv allow.
    • The .envrc file provided by the HyFI-Template will automatically set up a virtual environment for the project.
    • Activate the virtual environment by running: direnv reload.
  4. Customize the project:

    • Review the pre-configured project structure and make any necessary adjustments to align with the project's specific requirements.
    • Update the README.md file to include a brief description of the project, its objectives, and any relevant information for collaborators.
    • Customize the Hydra configurations in the config directory to define the settings and parameters specific to the project.
    • Define the necessary data structures using Pydantic models in the models directory to represent the entities and relationships relevant to the project.
  5. Install dependencies:

    • With the virtual environment activated, install the required dependencies by running: make install.
  6. Initialize version control:

    • Initialize a new Git repository in the project directory: git init.
    • Stage all the files: git add ..
    • Make an initial commit: git commit -m "Initialize repository with HyFI-Template".
    • Push the initial commit to the GitHub repository: git push -u origin main.
  7. Collaborate with the team:

    • Invite team members and collaborators to the GitHub repository.
    • Assign appropriate roles and permissions to each collaborator based on their responsibilities.
    • Encourage the team to familiarize themselves with the HyFI-Template documentation and guidelines to ensure a smooth development process.

Expected Outcome

A properly initialized repository based on the HyFI-Template, with a virtual environment automatically set up using the provided .envrc file. The repository should have a well-structured codebase, Hydra configurations, Pydantic models, and the necessary dependencies installed. The team should be able to collaborate effectively using the HyFI framework and its best practices, allowing for the development of flexible and adaptable interfaces for various Python projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment