Skip to content

Commit

Permalink
Merge pull request #147 from GriceTurrble/docs/readme-updates-2024
Browse files Browse the repository at this point in the history
docs: updates to 2024 readmes
  • Loading branch information
GriceTurrble authored Dec 1, 2024
2 parents bcbcff3 + 8b82e6c commit fa6b2c6
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
18 changes: 18 additions & 0 deletions 2024/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# AoC 2024

Welcome to my 2024 solutions for Advent of Code!

This year I have a few goals in mind, so I aim to be busy in this section this month:

- I want to learn more about [uv](https://docs.astral.sh/uv/),
so I'm writing [Python solutions](python) using `uv` as the main management tool.
- I am starting a new position that involves coding in **Ruby on Rails** and **React**,
so I want to hone my skills by duplicating solutions in both Ruby and TypeScript.
- I still want to champion a transition to **Rust** in my work,
so I am also duplicating solutions in Rust.

Seems ambitious, for sure.
Should keep me busy throughout the month. 🙂

With the advent (heh) of AI tooling, I am making some use of Copilot to assist with the small bits.
I'm not having it actually solve the problem for me, but it's filling in boilerplate and helping me type faster.
36 changes: 35 additions & 1 deletion 2024/python/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# AoC 2024, in Python
# AoC 2024 Python solutions

## Getting started

This project uses `uv` for all tooling.

To install `uv`, such as through Homebrew:

```shell
brew install uv
```

Run any given day using `uv run dayXX`, where `XX` is the number of the day:

```shell
uv run day01
```

Run tests across the project using `uv run pytest`.

## CLI options

There is a `cli` script included in the project which, among other things (maybe) can scaffold the files for a new day.

Run `uv run cli --help` for details.

To create a new day, use the `create-day` command, followed by the number of the new day:

```shell
uv run cli create-day 5
```

If a directory for the given day already exists, an error is raised.
It will also attempt to add a script entry point to [`pyproject.toml`](pyproject.toml) (in the `[project.scripts]` table) for that new day.
If such a script already exists, an error is raised.
1 change: 1 addition & 0 deletions 2024/python/src/grice_py_aoc_2024/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def _create_templates(day: int, path: Path) -> None:
@cli.command()
@click.argument("day", type=int)
def create_day(day: int) -> None:
"""Scaffold the files and pyproject.toml script for DAY."""
day_path = DIR / f"day{day:0>2}"
if day_path.exists():
raise click.ClickException(f"Day {day} already exists at {day_path}")
Expand Down

0 comments on commit fa6b2c6

Please sign in to comment.