Skip to content

Commit

Permalink
TEMPORARY COMMIT - DO NOT MERGE
Browse files Browse the repository at this point in the history
  • Loading branch information
JockeTF committed Sep 25, 2024
1 parent a396a13 commit 245be08
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 171 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,27 @@ jobs:
- '3.12'

steps:
- name: Clone Repository
- name: Clone repository
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Tox
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Configure uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true

- name: Sync dependencies
run: uv sync --all-extras --dev

- name: Check styling
run: uv run flake8 --ignore=E123,E231 fimfarchive tests

- name: Check types
run: uv run mypy

- name: Invoke Tox
run: tox
- name: Run tests
run: uv run pytest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ Thumbs.db
# Python cache.
__pycache__/

# Lock files.
uv.lock

# Virtual environment.
venv/
.venv/

# Vim settings.
.vim/
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,22 @@ Start by creating a clone of the Fimfarchive repository.
git clone https://github.com/JockeTF/fimfarchive.git
```

Enter the cloned repository and create a virtual environment called `venv`
within it. Make sure to activate the virtual environment before proceeding to
install the development dependencies.
Enter the cloned repository and install the development dependencies.

```bash
python3 -m pip install -r requirements.txt
uv sync
```

Optionally also install `lz4` to lower the memory footprint of open archives.

```bash
python3 -m pip install lz4
uv sync --extra lz4
```

All done! Run the test suite to make sure everything works as expected.

```bash
pytest
uv run pytest
```

[virtual environment]: https://docs.python.org/3/tutorial/venv.html
Expand All @@ -91,11 +89,11 @@ pytest
# Running

Fimfarchive has a command line interface which is invoked as a Python module.
It can't do much except prepare new Fimfarchie releases. For archive browsing
It can't do much except prepare new Fimfarchive releases. For archive browsing
you will need to use third-party tools, or make your own.

```
$ python3 -m fimfarchive
$ uv run python -m fimfarchive
Usage: COMMAND [PARAMETERS]
Fimfarchive, ensuring that history is preseved.
Expand All @@ -109,7 +107,7 @@ The command line interface features multiple subcommands, each with its own
brief help text. The subcommand is specified as the second program argument.

```
$ python3 -m fimfarchive update --help
$ uv run python -m fimfarchive update --help
usage: [-h] [--alpha] --archive PATH [--refetch]
Updates stories for Fimfarchive.
Expand Down
16 changes: 8 additions & 8 deletions fimfarchive/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
r"""
______ _ __ _ _
| ___(_)_ __ ___ / _| __ _ _ __ ___| |__ (_)_ _____
| |_ | | '_ ` _ \| |_ / _` | '__/ __| '_ \| \ \ / / _ \
| _| | | | | | | | _| (_| | | | (__| | | | |\ V / __/
|_| |_|_| |_| |_|_| \__,_|_| \___|_| |_|_| \_/ \___|
______ _ __ _ _
| ___(_)_ __ ___ / _| __ _ _ __ ___| |__ (_)_ _____
| |_ | | '_ ` _ \| |_ / _` | '__/ __| '_ \| \ \ / / _ \
| _| | | | | | | | _| (_| | | | (__| | | | |\ V / __/
|_| |_|_| |_| |_|_| \__,_|_| \___|_| |_|_| \_/ \___|
"""


#
# Fimfarchive, preserves stories from Fimfiction.
# Copyright (C) 2015 Joakim Soderlund
# Copyright (C) 2024 Joakim Soderlund
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -28,6 +28,6 @@


__author__ = 'Joakim Soderlund'
__copyright__ = 'Copyright (C) 2015 Joakim Soderlund'
__copyright__ = 'Copyright (C) 2024 Joakim Soderlund'
__license__ = 'GPLv3'
__version__ = '0.1.0'
4 changes: 2 additions & 2 deletions fimfarchive/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#
# Fimfarchive, preserves stories from Fimfiction.
# Copyright (C) 2019 Joakim Soderlund
# Copyright (C) 2024 Joakim Soderlund
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -38,7 +38,7 @@
__all__ = (
'Writer',
'DirectoryWriter',
'FimfarchiveWriter'
'FimfarchiveWriter',
)


Expand Down
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[project]
name = "fimfarchive"
version = "0.1.0"
description = "Preserves stories from Fimfiction"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"arrow~=1.3",
"bbcode~=1.1",
"blinker~=1.8",
"importlib-resources~=6.4",
"jinja2~=3.1",
"jmespath~=1.0",
"jsonapi-client",
"requests~=2.32",
"tqdm~=4.66",
]

[project.optional-dependencies]
lz4 = ["lz4~=4.3"]

[tool.uv]
compile-bytecode = true
dev-dependencies = [
"flake8~=5.0",
"mypy~=1.11",
"pytest~=8.3",
"requests-mock~=1.12",
"types-jmespath~=1.0",
"types-requests~=2.32",
"types-tqdm~=4.66",
]

[tool.uv.sources.jsonapi-client]
git = "https://github.com/JockeTF/jsonapi-client.git"

[tool.mypy]
files = ["fimfarchive", "tests"]
ignore_missing_imports = true

[tool.pyright]
venvPath = "."
venv = ".venv"

[tool.pytest.ini_options]
testpaths = ["tests"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
16 changes: 0 additions & 16 deletions requirements.txt

This file was deleted.

98 changes: 0 additions & 98 deletions setup.py

This file was deleted.

29 changes: 0 additions & 29 deletions tox.ini

This file was deleted.

0 comments on commit 245be08

Please sign in to comment.