Skip to content

Sathwik-918/python-helloworld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI Configuration Template Project Setup for Continuous Integration and Deployment Overview This repository contains a reusable CircleCI configuration template for automated testing, building, and releasing projects. CircleCI Configuration Features Workflow Steps

Checkout code Create virtual environment Install dependencies Run tests Build executable Create GitHub Release

Prerequisites

CircleCI Account GitHub Repository Personal Access Token

Configuration Setup

  1. GitHub Personal Access Token

Go to GitHub Settings Developer settings > Personal access tokens Generate a fine-grained token with:

Repository access Permissions:

Contents (Read and Write) Metadata (Read-only) Releases (Read and Write)

  1. CircleCI Environment Variables In CircleCI project settings, add these environment variables:

GH_TOKEN: GitHub personal access token Other project-specific variables as needed

Customizing the Configuration Modify config.yml Adjust these sections for your project: yamlCopy# Python version

  • image: cimg/python:3.9 # Change to your Python version

Dependency installation

  • run: name: Install Dependencies command: | pip install -r requirements.txt pip install pyinstaller # Add/remove as needed

Test command

  • run: name: Run Tests command: pytest tests/ # Change to your test runner

Build command

  • run: name: Build Executable command: pyinstaller --onefile src/your_script.py # Adjust path Project Structure Recommendations Copyproject-root/ │ ├── .circleci/ │ └── config.yml # CircleCI configuration │ ├── src/ │ └── main_script.py # Main application script │ ├── tests/ │ └── test_main.py # Test files │ ├── requirements.txt # Project dependencies └── README.md Troubleshooting Common Issues

Ensure GitHub token has correct repository permissions Verify virtual environment activation Check dependency installations Confirm test script paths

Debugging CircleCI Builds

Check CircleCI web interface for detailed logs Verify environment variables Test commands locally before pushing

Best Practices

Use minimal required permissions for GitHub token Regularly rotate access tokens Keep dependencies up to date Maintain comprehensive test coverage

Supported Project Types

Python applications Executable builds Automated releases

Contributing

Fork the repository Create a feature branch Submit a pull request with detailed description

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published