Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Oct 17, 2023
2 parents 70bf163 + 35dc4e1 commit 7ee075e
Show file tree
Hide file tree
Showing 36 changed files with 674 additions and 225 deletions.
4 changes: 3 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 0.15.14
_commit: 1.1.0
_src_path: gh:pawamoy/copier-pdm
author_email: pawamoy@pm.me
author_fullname: Timothée Mazzucotelli
Expand All @@ -9,8 +9,10 @@ copyright_holder: Timothée Mazzucotelli
copyright_holder_email: pawamoy@pm.me
copyright_license: ISC License
insiders: true
insiders_repository_name: markdown-exec
project_description: Utilities to execute code blocks in Markdown files.
project_name: Markdown Exec
public_release: true
python_package_command_line_name: ''
python_package_distribution_name: markdown-exec
python_package_import_name: markdown_exec
Expand Down
73 changes: 51 additions & 22 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,61 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
about: Create a bug report to help us improve.
title: "bug: "
labels: unconfirmed
assignees: ''

assignees: [pawamoy]
---

**Describe the bug**
A clear and concise description of what the bug is.
### Description of the bug
<!-- Please provide a clear and concise description of what the bug is. -->

### To Reproduce
<!-- Please provide a Minimal Reproducible Example (MRE) if possible.
Try to boil down the problem to a few lines of code.
Your code should run by simply copying and pasting it.
Example:
```
git clone https://github.com/username/repro
cd repro
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
... # command or code showing the issue
```
-->

```
WRITE MRE / INSTRUCTIONS HERE
```

### Full traceback
<!-- Please provide the full error message / traceback if any, by pasting it in the code block below.
No screenshots! -->

<details><summary>Full traceback</summary>

```python
PASTE TRACEBACK HERE
```

</details>

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Run command '...'
3. Scroll down to '...'
4. See error
### Expected behavior
<!-- Please provide a clear and concise description of what you expected to happen. -->

**Expected behavior**
A clear and concise description of what you expected to happen.
### Environment information
<!-- Please run the following command in your repository and paste its output below it,
redacting sensitive information. -->

**Screenshots**
If applicable, add screenshots to help explain your problem.
```bash
python -m markdown_exec.debug # | xclip -selection clipboard
```

**System (please complete the following information):**
- `Markdown Exec` version: [e.g. 0.2.1]
- Python version: [e.g. 3.8]
- OS: [Windows/Linux]
PASTE OUTPUT HERE

**Additional context**
Add any other context about the problem here.
### Additional context
<!-- Add any other relevant context about the problem here,
like links to other issues or pull requests, screenshots, etc.
-->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: I have a question / I need help
url: https://github.com/pawamoy/markdown-exec/discussions/new?category=q-a
about: Ask and answer questions in the Discussions tab.
23 changes: 11 additions & 12 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
about: Suggest an idea for this project.
title: "feature: "
labels: feature
assignees: ''

assignees: pawamoy
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Is your feature request related to a problem? Please describe.
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]. -->

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
### Describe alternatives you've considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
Add any other context or screenshots about the feature request here.
### Additional context
<!-- Add any other context or screenshots about the feature request here. -->
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: ci

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

defaults:
run:
Expand All @@ -27,6 +25,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Fetch all tags
run: git fetch --depth=1 --tags

- name: Set up Graphviz
uses: ts-graphviz/setup-graphviz@v1

Expand Down Expand Up @@ -93,8 +94,8 @@ jobs:
- "3.11"
- "3.12"
exclude: ${{ fromJSON(needs.exclude-test-jobs.outputs.jobs) }}

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.python-version == '3.12' }}

steps:
- name: Checkout
Expand All @@ -104,6 +105,7 @@ jobs:
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
allow-python-prereleases: true

- name: Resolving dependencies
run: pdm lock -v --no-cross-platform -G ci-tests
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/dists.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: release

on: push
permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch all tags
run: git fetch --depth=1 --tags
- name: Setup Python
uses: actions/setup-python@v4
- name: Install build
if: github.repository_owner == 'pawamoy-insiders'
run: python -m pip install build
- name: Build dists
if: github.repository_owner == 'pawamoy-insiders'
run: python -m build
- name: Upload dists artifact
uses: actions/upload-artifact@v3
if: github.repository_owner == 'pawamoy-insiders'
with:
name: markdown-exec-insiders
path: ./dist/*
- name: Install git-changelog
if: github.repository_owner != 'pawamoy-insiders'
run: pip install git-changelog
- name: Prepare release notes
if: github.repository_owner != 'pawamoy-insiders'
run: git-changelog --release-notes > release-notes.md
- name: Create release with assets
uses: softprops/action-gh-release@v1
if: github.repository_owner == 'pawamoy-insiders'
with:
files: ./dist/*
- name: Create release
uses: softprops/action-gh-release@v1
if: github.repository_owner != 'pawamoy-insiders'
with:
body_path: release-notes.md
1 change: 0 additions & 1 deletion .gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM gitpod/workspace-full
USER gitpod
ENV PIP_USER=no
ENV PYTHON_VERSIONS=
RUN pip3 install pipx; \
pipx install pdm; \
pipx ensurepath
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- insertion marker -->
## [1.7.0](https://github.com/pawamoy/markdown-exec/releases/tag/1.7.0) - 2023-10-17

<small>[Compare with 1.6.0](https://github.com/pawamoy/markdown-exec/compare/1.6.0...1.7.0)</small>

### Features

- Set `MKDOCS_CONFIG_DIR` environment variable to build file path relative to it ([a2cbea5](https://github.com/pawamoy/markdown-exec/commit/a2cbea52d39ef43960c910830eae14dc846624d0) by Timothée Mazzucotelli).

## [1.6.0](https://github.com/pawamoy/markdown-exec/releases/tag/1.6.0) - 2023-04-18

<small>[Compare with 1.5.3](https://github.com/pawamoy/markdown-exec/compare/1.5.3...1.6.0)</small>
Expand Down
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,19 @@ Run `make help` to see all the available actions!
This project uses [duty](https://github.com/pawamoy/duty) to run tasks.
A Makefile is also provided. The Makefile will try to run certain tasks
on multiple Python versions. If for some reason you don't want to run the task
on multiple Python versions, you can do one of the following:
1. `export PYTHON_VERSIONS= `: this will run the task
with only the current Python version
2. run the task directly with `pdm run duty TASK`
on multiple Python versions, you run the task directly with `pdm run duty TASK`.
The Makefile detects if a virtual environment is activated,
so `make` will work the same with the virtualenv activated or not.
If you work in VSCode,
[see examples of tasks and run configurations](https://pawamoy.github.io/copier-pdm/work/#vscode-setup).
## Development
As usual:
1. create a new branch: `git checkout -b feature-or-bugfix-name`
1. create a new branch: `git switch -c feature-or-bugfix-name`
1. edit the code and/or the documentation
**Before committing:**
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DEFAULT_GOAL := help
SHELL := bash
DUTY := $(if $(VIRTUAL_ENV),,pdm run) duty
export PDM_MULTIRUN_VERSIONS ?= 3.8 3.9 3.10 3.11 3.12

args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
check_quality_args = files
Expand All @@ -17,7 +18,8 @@ BASIC_DUTIES = \
docs \
docs-deploy \
format \
release
release \
vscode

QUALITY_DUTIES = \
check-quality \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this HTML is injected in place of the code block.
## Installation

With `pip`:

```bash
pip install markdown-exec[ansi]
```
Expand Down
5 changes: 4 additions & 1 deletion config/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
target-version = "py37"
target-version = "py38"
line-length = 132
exclude = [
"fixtures",
Expand Down Expand Up @@ -77,6 +77,9 @@ ignore = [
"src/*/cli.py" = [
"T201", # Print statement
]
"src/*/debug.py" = [
"T201", # Print statement
]
"scripts/*.py" = [
"INP001", # File is part of an implicit namespace package
"T201", # Print statement
Expand Down
36 changes: 36 additions & 0 deletions config/vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "python (current file)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "test",
"type": "python",
"request": "launch",
"module": "pytest",
"justMyCode": false,
"args": [
"-c=config/pytest.ini",
"-vvv",
"--no-cov",
"--dist=no",
"tests",
"-k=${input:tests_selection}"
]
}
],
"inputs": [
{
"id": "tests_selection",
"type": "promptString",
"description": "Tests selection",
"default": ""
}
]
}
Loading

0 comments on commit 7ee075e

Please sign in to comment.