Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI Checks

on:
pull_request:
branches: [main] # Or your default branch

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # Adjust if you have dev requirements
# Install dev tools if not in requirements.txt
pip install ruff mypy pytest pytest-cov

- name: Run Ruff (Linting & Formatting Check)
run: |
ruff check src/
ruff format --check src/

- name: Run MyPy (Type Checking)
run: |
mypy src/
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Python Package to PyPI

on:
push:
tags:
- "v*.*.*" # Trigger on tags like v0.1.0, v1.2.3

jobs:
deploy:
runs-on: ubuntu-latest

# Optional: Use environments for protection rules
# environment:
# name: pypi
# url: https://pypi.org/p/build-influence # Replace with your package name

# Grant GITHUB_TOKEN permissions to authenticate with PyPI using OIDC (more secure, recommended)
permissions:
id-token: write # Required for trusted publishing

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build dependencies
run: python -m pip install --upgrade build twine

- name: Build package
run: python -m build

# Preferred: Publish using Trusted Publishing (OIDC)
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# No API token needed here if PyPI project is configured for trusted publishing

# --- Alternative: Publish using API Token (keep only ONE publish step) ---
# Uncomment the step below and comment out the Trusted Publishing step above
# if you prefer using the API token secret.
# Ensure you have configured the PYPI_API_TOKEN secret in GitHub repo settings.
# - name: Publish package to PyPI using API Token
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
# ---------------------------------------------------------------------
66 changes: 66 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Contributing to Build Influence

First off, thank you for considering contributing to Build Influence! We welcome any help, from reporting bugs and suggesting features to submitting code changes.

## How Can I Contribute?

### Reporting Bugs

- **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/drorivry/build-influence/issues). (Replace `drorivry/build-influence` with your actual repository path if different).
- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/drorivry/build-influence/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample or an executable test case** demonstrating the expected behavior that is not occurring.

### Suggesting Enhancements

- Open a new issue using the Feature Request template.
- Clearly describe the enhancement and the motivation for it.
- Explain why this enhancement would be useful.
- Provide code examples if applicable.

### Pull Requests

We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes (`pytest tests/`).
5. Make sure your code lints (`ruff check src/ tests/`) and is formatted (`ruff format src/ tests/`).
6. Ensure type checks pass (`mypy src/ tests/`).
7. Issue that pull request!

## Development Setup

1. Fork the repository on GitHub.
2. Clone your fork locally:
```bash
git clone [email protected]:YOUR_USERNAME/build-influence.git
cd build-influence
```
3. Create a virtual environment (recommended):
```bash
python3.12 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```
4. Install dependencies:
```bash
pip install -r requirements.txt
# Install development/testing tools if they are not in requirements.txt
pip install ruff mypy pytest pytest-cov build twine
```

## Coding Standards

- Please follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide.
- Use `ruff` for linting and formatting. Our CI pipeline checks this, so please run `ruff format src/ tests/` before committing.
- Use type hints (`mypy`) for static analysis. Our CI pipeline checks this.
- Write tests using `pytest` for new functionality.

## Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. (Consider adding a `CODE_OF_CONDUCT.md` file).

## Any questions?

Feel free to open an issue if you have questions about contributing.

Thank you for your contribution!
Loading