Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions .github/workflow-actions/cleanup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Cleanup Environment'
description: 'Clean up build artifacts and temporary files'
runs:
using: "composite"
steps:
- name: Clean up
shell: bash
run: |
yes | make clean || true
26 changes: 26 additions & 0 deletions .github/workflow-actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Setup Environment'
description: 'Setup Python 3.13.7 and print system information'
runs:
using: "composite"
steps:
- name: Set up Python 3.13.7
uses: actions/setup-python@v5
with:
python-version: '3.13.7'

- name: Print system information
shell: bash
run: |
echo "::group::System information"
echo "::notice title=Operating system::Linux."
echo "::notice title=Kernel::$(uname -a)."
echo "::notice title=Python::$(python --version 2>&1)."
echo "::endgroup::"

- name: Setup virtual environment
shell: bash
run: |
echo "::group::ARES environment setup"
pipx install uv
make setup-venv
echo "::endgroup::"
29 changes: 29 additions & 0 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check Format Pipeline

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
check-format:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Environment
uses: ./.github/workflow-actions/setup

- name: Run ruff for format checking
run: |
make format-check

- name: Cleanup Environment
uses: ./.github/workflow-actions/cleanup
29 changes: 29 additions & 0 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test Coverage Pipeline

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test-coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Environment
uses: ./.github/workflow-actions/setup

- name: Run coverage tests
run: |
make test-coverage

- name: Cleanup Environment
uses: ./.github/workflow-actions/cleanup
29 changes: 29 additions & 0 deletions .github/workflows/test_requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test Requirements Pipeline

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test-requirements:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Environment
uses: ./.github/workflow-actions/setup

- name: Run requirements tests
run: |
make test-requirements

- name: Cleanup Environment
uses: ./.github/workflow-actions/cleanup
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ docs/_build/*
*.pyc
*.pyo
.python-version
version.py

# coverage
.coverage
Expand Down
37 changes: 37 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html.
116 changes: 15 additions & 101 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,151 +2,65 @@
# commands:
# - make setup-venv
# - make examples
# - make test-examples
# - make test-requirements
# - make test-coverage
# - make format
# - make format-check
# - make build-executable
# - make docs
# - make clean
# - make clean-light
# - make release-checklist
# - make release-changelog
# - make thirdpartycheck
# - make release-upload
# - make release
# - make clean

VENV_DIR := .venv
VENV_RECREATE := false
VENV_RELEASE := false
# Release metadata is maintained in pyproject.toml and checked against the tag.
RELEASE_TAG := $(shell git describe --tags --exact-match --match 'v[0-9]*' 2>/dev/null)
VERSION := $(shell sed -n 's/^version = "\([^"]*\)"/\1/p' pyproject.toml)
RELEASE_ARCHIVE := dist/ares-$(VERSION)-release.zip

# Platform detection for virtual environment binary path
ifeq ($(OS),Windows_NT)
VENV_BIN := $(VENV_DIR)/Scripts
PLATFORM := windows
PATHSEP := ;
else
VENV_BIN := $(VENV_DIR)/bin
PLATFORM := unix
PATHSEP := :
endif

# Main setup-venv target - uses POSIX shell commands (works with Git Bash on Windows)
.PHONY: setup-venv
setup-venv:
@if [ -d "$(VENV_DIR)" ]; then \
echo "Virtual environment '$(VENV_DIR)' already exists. For recreation add 'VENV_RECREATE=true' to cli."; \
if [ "$(VENV_RECREATE)" = "true" ] || [ "$(VENV_RECREATE)" = "TRUE" ]; then \
echo "Removing existing virtual environment '$(VENV_DIR)'..."; \
rm -rf "$(VENV_DIR)"; \
else \
exit 0; \
fi; \
fi; \
echo "Creating virtual environment '$(VENV_DIR)'..."; \
python -m venv "$(VENV_DIR)" || { echo "Error: Failed to create virtual environment."; exit 1; }; \
echo "Installing project dependencies in virtual environment '$(VENV_DIR)'..."; \
\
# Check if .git exists to decide on versioning strategy for editable install \
if [ ! -d ".git" ]; then \
echo "NOTE: .git directory not found. Setting pretend version for installation."; \
if [ "$(VENV_RELEASE)" = "true" ] || [ "$(VENV_RELEASE)" = "TRUE" ]; then \
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MATI=0.0.1 "$(VENV_BIN)/pip" install -e ".[release]" || { echo "Error: Failed to install dependencies (no Git)."; exit 1; }; \
else \
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MATI=0.0.1 "$(VENV_BIN)/pip" install -e ".[dev]" || { echo "Error: Failed to install dependencies (no Git)."; exit 1; }; \
fi; \
else \
echo "NOTE: .git directory found. Using setuptools_scm for versioning."; \
if [ "$(VENV_RELEASE)" = "true" ] || [ "$(VENV_RELEASE)" = "TRUE" ]; then \
"$(VENV_BIN)/pip" install -e ".[release]" || { echo "Error: Failed to install dependencies (with Git)."; exit 1; }; \
else \
"$(VENV_BIN)/pip" install -e ".[dev]" || { echo "Error: Failed to install dependencies (with Git)."; exit 1; }; \
fi; \
fi

.PHONY: examples
examples: setup-venv
@echo "TODO: Implementation"

.PHONY: test-examples
test-examples: setup-venv
@echo "TODO: Implementation"

echo "Syncing project dependencies:"
uv sync --all-extras

.PHONY: test-requirements
test-requirements: setup-venv
@echo "TODO: Implementation"
uv run pytest

.PHONY: test-coverage
test-coverage: setup-venv
@echo "TODO: Implementation"
NUMBA_DISABLE_JIT=1 uv run pytest --cov --cov-report=html --cov-report=term-missing

.PHONY: format
format: setup-venv
@"$(VENV_BIN)/ruff" format .
uv run ruff format .

.PHONY: format-check
format-check: setup-venv
@"$(VENV_BIN)/ruff" format --check .

.PHONY: build-executable
build-executable: setup-venv
@echo "TODO: Implementation"

.PHONY: release-checklist
release-checklist:
@echo "TODO: Implementation"

.PHONY: release-changelog
release-changelog:
@echo "TODO: Implementation"
uv run ruff format --check .

.PHONY: thirdpartycheck
thirdpartycheck: setup-venv
@echo ""
@echo "Running third-party dependency analysis..."
@"$(VENV_BIN)/python" scripts/analyze_dependencies.py --format json --generate-notice --check-compatibility
uv run scripts/analyze_dependencies.py --format json --generate-notice --check-compatibility
@echo "Third-party dependency check complete."

.PHONY: release-upload
release-upload:
@echo "TODO: Implementation"

.PHONY: release
release: release-checklist release-changelog thirdpartycheck build-executable release-upload
@echo "TODO: Implementation"

.PHONY: docs
docs: setup-venv
@echo "TODO: Implementation"

.PHONY: clean
clean:
@printf "WARNING: This will permanently delete all generated files, caches, and logs. Continue? [y/n] "; \
read -r REPLY; \
if [ "$$REPLY" = "y" ] || [ "$$REPLY" = "Y" ]; then \
echo "Cleaning project in mode full..."; \
$(MAKE) clean-light; \
rm -rf logs; \
rm -rf build; \
rm -rf dist; \
rm -rf examples/output; \
rm -rf docs/_build; \
echo "Project cleaned successfully in mode full."; \
else \
echo "Clean cancelled."; \
fi

.PHONY: clean-light
clean-light:
echo "Cleaning project in mode light..."; \
echo "Cleaning project..."; \
find . -type f -name "*.pyc" -delete; \
find . -type d -name "__pycache__" -exec rm -rf {} +; \
find . -type d -name "log" -exec rm -rf {} +; \
find . -type d -name ".pytest_cache" -exec rm -rf {} +; \
find . -type d -name ".ruff_cache" -exec rm -rf {} +; \
find . -type f -name "*.spec" -delete; \
rm -f .coverage .coverage.*; \
rm -rf htmlcov; \
$(MAKE) -C examples/sim_unit clean; \
rm -rf logs; \
echo "Project cleaned successfully in mode light."; \
Loading
Loading