Skip to content

Commit

Permalink
Add new mloq template
Browse files Browse the repository at this point in the history
Signed-off-by: guillemdb <[email protected]>
  • Loading branch information
guillemdb committed Sep 28, 2024
1 parent 3739b83 commit 8bb7ba2
Show file tree
Hide file tree
Showing 62 changed files with 2,433 additions and 928 deletions.
28 changes: 28 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[bumpversion]
current_version = 0.0.0
commit = True
tag = True

[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"

[bumpversion:file (badge):README.rst]
search = /v{current_version}.svg
replace = /v{new_version}.svg

[bumpversion:file (link):README.rst]
search = /v{current_version}...main
replace = /v{new_version}...main

[bumpversion:file:docs/conf.py]
search = version = release = "{current_version}"
replace = version = release = "{new_version}"

[bumpversion:file:src/mloq_template/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[bumpversion:file:.cookiecutterrc]
search = version: {current_version}
replace = version: {new_version}
66 changes: 66 additions & 0 deletions .cookiecutterrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This file exists so you can easily regenerate your project.
#
# `cookiepatcher` is a convenient shim around `cookiecutter`
# for regenerating projects (it will generate a .cookiecutterrc
# automatically for any template). To use it:
#
# pip install cookiepatcher
# cookiepatcher gh:ionelmc/cookiecutter-pylibrary mloq-template
#
# See:
# https://pypi.org/project/cookiepatcher
#
# Alternatively, you can run:
#
# cookiecutter --overwrite-if-exists --config-file=mloq-template/.cookiecutterrc gh:ionelmc/cookiecutter-pylibrary

default_context:
c_extension_support: "no"
codacy: "no"
codacy_projectid: "[Get ID from https://app.codacy.com/gh/guillemdb/mloq-template/settings]"
codeclimate: "no"
codecov: "yes"
command_line_interface: "plain"
command_line_interface_bin_name: "mloq-template"
coveralls: "no"
distribution_name: "mloq-template"
docstring_code_line_length: "80"
email: "[email protected]"
formatter_quote_style: "double"
full_name: "Guillem Duran Ballester"
function_name: "compute"
github_actions: "yes"
github_actions_osx: "yes"
github_actions_windows: "yes"
license: "BSD 2-Clause License"
line_length: "99"
lock_file_support: false
module_name: "core"
package_name: "mloq_template"
pre_commit: "yes"
project_name: "MLOQ Template"
project_short_description: "An example package. Generated with cookiecutter-pylibrary."
project_slug: "mloq-template"
pypi_badge: "yes"
pypi_disable_upload: "no"
release_date: "today"
repo_hosting: "github.com"
repo_hosting_domain: "github.com"
repo_main_branch: "main"
repo_name: "mloq-template"
repo_url: "https://github.com/guillemdb/mloq-template"
repo_username: "guillemdb"
scrutinizer: "no"
setup_py_uses_setuptools_scm: "no"
sphinx_docs: "yes"
sphinx_docs_hosting: "https://mloq-template.readthedocs.io/"
sphinx_doctest: "no"
sphinx_theme: "furo"
target_python_version: "3.10"
test_matrix_separate_coverage: "no"
tests_inside_package: "no"
version: "0.0.0"
version_manager: "bump2version"
website: "fragile.tech"
year_from: "2024"
year_to: "2024"
16 changes: 16 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[paths]
source =
src
*/site-packages

[run]
branch = true
source =
mloq_template
tests
parallel = true

[report]
show_missing = true
precision = 2
omit = *migrations*
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# see https://editorconfig.org/
root = true

[*]
# Use Unix-style newlines for most files (except Windows files, see below).
end_of_line = lf
trim_trailing_whitespace = true
indent_style = space
insert_final_newline = true
indent_size = 4
charset = utf-8

[*.{bat,cmd,ps1}]
end_of_line = crlf

[*.{yml,yaml}]
indent_size = 2

[*.tsv]
indent_style = tab
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/docs"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
versioning-strategy: lockfile-only
allow:
- dependency-type: "all"
66 changes: 66 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# Labels names are important as they are used by Release Drafter to decide
# regarding where to record them in changelog or if to skip them.
#
# The repository labels will be automatically configured using this file and
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
- name: breaking
description: Breaking Changes
color: bfd4f2
- name: bug
description: Something isn't working
color: d73a4a
- name: build
description: Build System and Dependencies
color: bfdadc
- name: ci
description: Continuous Integration
color: 4a97d6
- name: dependencies
description: Pull requests that update a dependency file
color: 0366d6
- name: documentation
description: Improvements or additions to documentation
color: 0075ca
- name: duplicate
description: This issue or pull request already exists
color: cfd3d7
- name: enhancement
description: New feature or request
color: a2eeef
- name: github_actions
description: Pull requests that update Github_actions code
color: "000000"
- name: good first issue
description: Good for newcomers
color: 7057ff
- name: help wanted
description: Extra attention is needed
color: 008672
- name: invalid
description: This doesn't seem right
color: e4e669
- name: performance
description: Performance
color: "016175"
- name: python
description: Pull requests that update Python code
color: 2b67c6
- name: question
description: Further information is requested
color: d876e3
- name: refactoring
description: Refactoring
color: ef67c4
- name: removal
description: Removals and Deprecations
color: 9ae7ea
- name: style
description: Style
color: c120e5
- name: testing
description: Testing
color: b1fc6f
- name: wontfix
description: This will not be worked on
color: ffffff
42 changes: 42 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name-template: '$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

categories:
- title: '🚀 Features'
labels:
- 'feat'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bug'
- title: 'Other updates'
labels:
- 'refactor'
- 'chore'
- 'docs'
- 'perf'
- 'test'
- 'documentation'

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.

version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch

template: |
## Changes
$CHANGES
Special thanks to: $CONTRIBUTORS
75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build

on: [push, pull_request]

jobs:
test:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python_version: ['3.10']

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch pre-commit
hatch env create
- name: Lint and typecheck
run: |
hatch run lint:all
- name: Run Tests
run: |
hatch run test:pytest
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true

release:
runs-on: ubuntu-latest
environment: release
needs: test
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install hatch pre-commit
- name: Build
run: |
hatch build
- name: Publish 📦 to Test PyPI
if: startsWith(github.ref, 'refs/heads/main')
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
user: __token__
password: ${{ secrets.TEST_PYPI_SECRECT }}
packages-dir: dist/
repository-url: https://test.pypi.org/legacy/
- name: Publish 📦 to PyPI
if: startsWith(github.ref, 'refs/heads/main')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_SECRECT }}
packages-dir: dist/
56 changes: 56 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build documentation

on:
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

# Default to bash
defaults:
run:
shell: bash

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch pre-commit
hatch env create docs
- name: Build
run: hatch run docs:build-check
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading

0 comments on commit 8bb7ba2

Please sign in to comment.