Skip to content
Merged
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
19 changes: 19 additions & 0 deletions .copier-answers-py.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changes here will be overwritten by Copier
#
# Updating `_src` could be helpful, see notes at:
# https://github.com/level12/coppy/wiki#creating-a-project
#
# Otherwise, NEVER EDIT MANUALLY
_commit: v1.20250523.1
_src_path: gh:level12/coppy
author_email: randy.syring@level12.io
author_name: Randy Syring
gh_org: level12
gh_repo: mu
hatch_version_tag_sign: true
project_name: Mu
py_module: mu
python_version: '3.13'
script_name: mu
use_circleci: false
use_gh_nox: true
18 changes: 18 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .coveragerc to control coverage.py
[run]
branch = True

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# testing assertions usually used with exceptions
assert False

# patterns for running cli
cli_entry()

[html]
directory = ci/coverage-html
47 changes: 47 additions & 0 deletions .github/workflows/nox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Nox

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

# Limit this workflow to a single run at a time per-branch to avoid wasting worker resources
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

jobs:
nox:
runs-on: ubuntu-latest

# Runs all steps inside this container
container:
image: ghcr.io/level12/ubuntu-mive:24-3.12
options: --user root

env:
UV_LINK_MODE: copy
MU_TEST_ACCT_ID: '429829037495'

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

- name: Mark repo as safe for Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::429829037495:role/mu-github-ci-role
aws-region: us-east-2

- name: Run Tests
run: |
uv run --only-group nox -- nox
47 changes: 36 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
*.egg-info
_shiv_dist
*.pyz
# Python
*.pyc
*.zip
*.egg-info
.venv

# Tox/Nox/Tests/Coverage
/.nox
/.tox
/ci/coverage-html
*.coverage
/coverage.xml
*.pytests.xml
.pytest_cache


# Editor Clutter
.vscode
.env
*.whl
.coverage*
coverage.xml
.ci/test-reports
.idea


# Build related
dist
abbr.fish
notes.md
/build
npm-debug.log
.*-cache
node_modules


# Local dev files
/mise.local.toml
/tmp

# Terraform
*.tfstate*
tf.plan
.terraform


# Project specific
19 changes: 11 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

default_language_version:
python: python3.11
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: check-ast
Expand All @@ -17,8 +13,7 @@ repos:
- id: check-added-large-files
- id: check-yaml
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Note: this version should be kept in-sync with the version used in standards.txt
rev: v0.1.13
rev: v0.11.13
hooks:
# i.e. `ruff check`
- id: ruff
Expand All @@ -29,3 +24,11 @@ repos:
# the formatter before pre-commit runs (presumably on save through their editor) and then
# the linting check above would always catch a problem created by the formatter.
args: [ --check ]
- repo: https://github.com/level12/pre-commit-hooks
rev: v0.20250226.1
hooks:
- id: check-ruff-versions
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.7.12
hooks:
- id: uv-lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
2 changes: 2 additions & 0 deletions ci/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
artifacts
test-reports
22 changes: 22 additions & 0 deletions env-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Example AWS CONFIG
#
#
# [profile example-org]
# region = us-east-2
# output = json
# mfa_serial = arn:aws:iam::...
# credential_process = env-config-aws example-org
# envconfig_1pass = op://example-org/Employee/aws-secrets-item

# [profile mu-test]
# source_profile = example-org
# role_arn = arn:aws:iam::429829037495:role/OrganizationAccountAccessRole
# region = us-east-2

# [profile mu-ci]
# source_profile = example-org
# role_arn = arn:aws:iam::429829037495:role/mu-github-ci-role
# region = us-east-2

profile:
aws-mu-test:
AWS_PROFILE: mu-test
aws-mu-ci:
AWS_PROFILE: mu-ci
1 change: 0 additions & 1 deletion examples/flask/mu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ image-name = 'mu-flask'
# Also respresents how quickly a celery worker would see a new task if the first
# task errored out without sending a delete message to the queue.
VisibilityTimeout = '3600' # 1 hour

2 changes: 0 additions & 2 deletions examples/tasker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ services:
entrypoint: /bin/bash
tty: true
stdin_open: true


14 changes: 14 additions & 0 deletions hatch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Build
[build]
dev-mode-dirs = ['src']


## Env: default
[envs.default]
installer = "uv"


## Version
[version]
source = 'regex_commit'
path = 'src/mu/version.py'
22 changes: 18 additions & 4 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
[env]
PROJECT_SLUG = '{{ config_root | basename | slugify }}'

_.python.venv.path = '{% if env.UV_PROJECT_ENVIRONMENT %}{{ env.UV_PROJECT_ENVIRONMENT }}{% else %}.venv{% endif %}'
_.python.venv.create = true


FLASK_DEBUG = '1'

# Override in a local mise config file if this doesn't match your acct.
# Override in a local mise.local.toml to match the id of the AWS account you use when testing mu.
# This should be a DEDICATED TEST ACCOUNT, don't risk it by using a shared account.
MU_TEST_ACCT_ID = '429829037495'

[tools]
python.version = "3.11"
python.virtualenv = "{{env.WORKON_HOME}}/mu-dev"

[task_config]
includes = [
'tasks',
]


[settings]
# Coppy projects uses .python-version because both mise and uv respect it.
idiomatic_version_file_enable_tools = ['python']
48 changes: 0 additions & 48 deletions mise/tasks/_shared.py

This file was deleted.

70 changes: 0 additions & 70 deletions mise/tasks/aws-creds-refresh

This file was deleted.

16 changes: 0 additions & 16 deletions mise/tasks/reqs-bootstrap

This file was deleted.

Loading
Loading