Skip to content

Commit

Permalink
Merge branch 'main' into feat/count-param
Browse files Browse the repository at this point in the history
  • Loading branch information
essteer authored Sep 28, 2024
2 parents fde0638 + 993d344 commit 4bb0097
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 51 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p align="center">
<a href="https://github.com/essteer/masquer/actions/workflows/test.yaml"><img src="https://github.com/essteer/masquer/actions/workflows/test.yaml/badge.svg"></a>
<a href="https://pypi.org/project/masquer/"><img src="https://img.shields.io/badge/PyPI-v1.2.2-3775A9.svg?style=flat&logo=PyPI&logoColor=white"></a>
<a href="https://pypi.org/project/masquer/"><img src="https://img.shields.io/pypi/v/masquer?style=flat&logo=PyPI&logoColor=white&label=PyPI&labelColor=555&color=3776AB"></a>
<a href="https://pypi.org/project/masquer/"><img src="https://img.shields.io/badge/Python-3.9_~_3.12-3776AB.svg?style=flat&logo=Python&logoColor=white"></a>
<a href="https://snyk.io/test/github/essteer/masquer"><img src="https://snyk.io/test/github/essteer/masquer/badge.svg?name=Snyk&style=flat&logo=Snyk"></a>
</p>
Expand Down Expand Up @@ -70,12 +70,12 @@ $ curl -X GET 'https://masquer.fly.dev/api/v1/masq?ua=true&rf=true' -H 'accept:
Refer to the [API docs](`https://masquer.fly.dev/docs`) for other examples, or see [more details below](#examples) in the package documentation.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Python package

[![](https://img.shields.io/badge/PyPI-masquer-3775A9.svg?style=flat&logo=PyPI&logoColor=white)](https://pypi.org/project/masquer/)
[![PyPI](https://img.shields.io/badge/PyPI-masquer-3775A9.svg?style=flat&logo=PyPI&logoColor=white)](https://pypi.org/project/masquer/)

### Installation

Expand Down Expand Up @@ -190,12 +190,12 @@ To get the header-data with randomly selected user-agent and/or referer data, pa
```

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Git repository

[![](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)
[![GitHub](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)

Clone the `masquer` repo for the full source code, including the FastAPI app used to host the [API](#api) introduced above.

Expand Down Expand Up @@ -262,7 +262,7 @@ Then follow the instructions FastAPI provides in the terminal.
To view the API's interactive documentation, run the app and navigate to `http://127.0.0.1:8000/docs` or `http://127.0.0.1:8000/redoc`.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Docker image
Expand All @@ -286,5 +286,5 @@ $ docker run -d --name masquer -p 8000:8000 essteer/masquer
Then interact as per the [API instructions](#api) above.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>
39 changes: 19 additions & 20 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Asset updates are performed on a regular basis to keep the user-agent and refere

A typical workflow up to the testing stage is outlined in this section.

### Create feature branch

Activate the virtual environment then create and checkout a new branch such as `asset-update`.

```console
Expand All @@ -50,7 +52,7 @@ For an asset update, follow the instructions detailed under the [`Asset updates`
If the process is successful and no issues arose, continue to the testing stage.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Test
Expand All @@ -67,7 +69,7 @@ Ensure all tests are passing before proceeding further.

### API tests

<a href="https://github.com/tiangolo/fastapi"><img src="https://img.shields.io/badge/FastAPI-009688?style=flat&logo=FastAPI&labelColor=555&logoColor=white"></a>
[![FastAPI](https://img.shields.io/badge/FastAPI-masquer-009688?style=flat&logo=FastAPI&logoColor=white)](https://masquer.fly.dev/docs)

Once the unit tests have passed, run the FastAPI app from the project root directory in development mode:

Expand All @@ -87,7 +89,7 @@ If the expected response is received, proceed to the Docker image tests.

### Docker image tests

<a href="https://hub.docker.com/r/essteer/masquer"><img src="https://img.shields.io/badge/masquer-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white"></a>
[![Docker](https://img.shields.io/badge/Docker-masquer-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white)](https://hub.docker.com/r/essteer/masquer)

Follow the steps detailed in [`docker.md`](https://github.com/essteer/masquer/blob/main/docs/docker.md) to build and test a Docker image locally.

Expand All @@ -96,7 +98,7 @@ Once the image and container are confirmed as running successfully, repeat the A
If each of the steps indicated above is successful, deployment can proceed to the next stage.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Version
Expand All @@ -113,15 +115,13 @@ New: 1.2.2

This will automatically update the version number in `src/masquer/__about__.py`, which is where the version information in `pyproject.toml` is read from for the main `masquer` program, and in `src/api/main.py` for the API.

Manually update the version number in the PyPI icon at the top of [`README.md`](https://github.com/essteer/masquer/blob/main/README.md) to match the new version number.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Format

<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Add and commit the version changes to git.

Expand All @@ -134,12 +134,12 @@ See the [`Formatting`](https://github.com/essteer/masquer/blob/main/docs/develop
Push to GitHub.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Merge to `main`

[![](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)
[![GitHub](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)

If the package build was successful, open a PR on GitHub to merge the updated package into `main` branch.

Expand All @@ -148,13 +148,13 @@ GitHub workflows are in place to do a final format and test whenever a commit or
See the [`GitHub Actions`](https://github.com/essteer/masquer/blob/main/docs/development.md#github-actions) section of [`development.md`](https://github.com/essteer/masquer/blob/main/docs/development.md) for more details.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Release and build Docker image

[![](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)
<a href="https://hub.docker.com/r/essteer/masquer"><img src="https://img.shields.io/badge/masquer-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white"></a>
[![GitHub](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)
[![Docker](https://img.shields.io/badge/Docker-masquer-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white)](https://hub.docker.com/r/essteer/masquer)

Assuming that the PR passed the GitHub Actions and the merge completed successfully, from the [main repo page](https://github.com/essteer/masquer) on GitHub click on the `Releases` heading then `Draft a new release`.

Expand All @@ -169,7 +169,7 @@ The `docker.yaml` GitHub workflow will then build a Docker image of the new vers
Follow the instructions in [`docker.md`](https://github.com/essteer/masquer/blob/main/docs/docker.md) to pull and test that the image is working as expected.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Build distribution
Expand All @@ -187,12 +187,12 @@ dist/masquer-1.2.2-py3-none-any.whl
```

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Publish to PyPI

<a href="https://pypi.org/project/masquer/"><img src="https://img.shields.io/badge/PyPI-3775A9.svg?style=flat&labelColor=555&logo=PyPI&logoColor=white"></a>
[![PyPI](https://img.shields.io/pypi/v/masquer?style=flat&logo=PyPI&logoColor=white&label=PyPI&labelColor=555&color=3776AB)](https://pypi.org/project/masquer/)

After a successful build the package is ready to publish on PyPI:

Expand All @@ -209,13 +209,12 @@ https://pypi.org/project/masquer/1.2.2/
```

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Deploy to production

<a href="https://masquer.fly.dev/docs"><img src="https://img.shields.io/badge/Fly.io-24175B.svg?style=flat&labelColor=555&logo=flydotio&logoColor=white"></a>

[![Fly.io](https://img.shields.io/badge/Fly.io-masquer-24175B.svg?style=flat&labelColor=555&logo=flydotio&logoColor=white)](https://masquer.fly.dev/docs)

From the project root directory, run the following command to deploy to production:

Expand All @@ -226,5 +225,5 @@ $ fly deploy
Visit the deployment at the link as prompted and test it via the API docs.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>
22 changes: 11 additions & 11 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ See also the main [`README.md`](https://github.com/essteer/masquer/blob/main/REA

## Git repository

[![](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)
[![GitHub](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)

Clone the `masquer` repo for the full source code:

Expand Down Expand Up @@ -51,7 +51,7 @@ The directory structure of the repo is as follows:
```

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Asset updates
Expand All @@ -75,12 +75,12 @@ In case of issues updating the assets, ensure all dependencies are installed and
If using custom JSON data, the `update_assets()` function inside `update.py` can still be used to sync changes with the `assets.py` file inside the `masquer` package.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Docker

<a href="https://hub.docker.com/r/essteer/masquer"><img src="https://img.shields.io/badge/Docker-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white"></a>
[![Docker](https://img.shields.io/badge/Docker-masquer-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white)](https://hub.docker.com/r/essteer/masquer)

In production `masquer` is deployed from a Docker image that is also called `masquer` and is registered here on Docker hub: [`https://hub.docker.com/r/essteer/masquer`](https://hub.docker.com/r/essteer/masquer).

Expand All @@ -98,12 +98,12 @@ During development &mdash; especially in the event of changes to the package dir
A `docker.yaml` workflow is in place to build and publish a Docker image when a new release is made on the `main` branch &mdash; see the notes in [`deployment.md`](https://github.com/essteer/masquer/blob/main/docs/deployment.md) and [`docker.md`](https://github.com/essteer/masquer/blob/main/docs/docker.md) for more details.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Formatting

<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Python files in `masquer` are formatted using Ruff.

Expand All @@ -116,12 +116,12 @@ A pre-commit hook is configured in `.pre-commit-config.yaml` to check and format
A GitHub action is configured in `.github/workflows/ruff.yaml` to run Ruff checks for any push or pull request to the `main` branch.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## GitHub Actions

[![](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)
[![GitHub](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)

GitHub actions are configured in `.github/workflows` and are in place for all pushes and pull requests for the `main` branch:

Expand All @@ -131,7 +131,7 @@ GitHub actions are configured in `.github/workflows` and are in place for all pu
A `docker.yaml` workflow is in place to build a new Docker image and publish it to Docker Hub whenever a new release is made on the `main` branch &mdash; see the [`deployment.md`](https://github.com/essteer/masquer/blob/main/docs/deployment.md) notes for more details.

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Logs
Expand Down Expand Up @@ -179,7 +179,7 @@ The following files are set up to record log messages:
| `src/masquer` | `app.py` | |

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Tests
Expand Down Expand Up @@ -215,5 +215,5 @@ A GitHub action is configured in `.github/workflows/test.yaml` to run the unit t
The tests are run on a matrix basis for Linux (Ubuntu), macOS and Windows on Python versions from `3.9` to `3.12` (inclusive).

<h3 align="center">
<a href="#"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
<a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>
Loading

0 comments on commit 4bb0097

Please sign in to comment.