Skip to content

Commit

Permalink
feat: add github test ci (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
leavers authored Dec 7, 2024
1 parent f753fcc commit ab65ee0
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 13 deletions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Expected Behavior


## Actual Behavior


## Steps to Reproduce the Problem

1.
1.
1.

## Specifications

- Version:
- Platform:
- Subsystem:
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Feature Request

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I have an issue when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen. Add any considered drawbacks.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Teachability, Documentation, Adoption, Migration Strategy**
If you can, explain how users will be able to use this and possibly write out a version the docs.
Maybe a screenshot or design?
37 changes: 37 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test Suite

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

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
tests:
name: "Python ${{ matrix.python-version }} ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"

- uses: pdm-project/setup-pdm@v4
with:
python-version: "${{ matrix.python-version }}"

- name: Install dependencies
run: pdm add -d nox rtoml

- name: Run tests
run: pdm run nox -s test_for_ci
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Fluentmap

[![Testing](https://github.com/leavers/fluentmap/actions/workflows/test-suite.yml/badge.svg)](https://github.com/leavers/fluentmap/actions/workflows/test-suite.yml)
[![Package version](https://img.shields.io/pypi/v/fluentmap.svg)](https://pypi.org/project/fluentmap/)
[![Python](https://img.shields.io/pypi/pyversions/fluentmap.svg)](https://pypi.org/project/fluentmap/)

Drop-in replacement for Python map with concurrency support.

15 changes: 14 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_dev_dependencies() -> Dict[str, str]:
pyproject = get_pyproject_toml()
pat = re.compile(r"[ <>~=]")
dev_deps: Dict[str, str] = {}
for dep in pyproject["tool"]["pdm"]["dev-dependencies"]["dev"]:
for dep in pyproject["dependency-groups"]["dev"]:
sep = -1
for m in pat.finditer(dep):
sep = m.span()[0]
Expand Down Expand Up @@ -190,3 +190,16 @@ def mypy(session: Session, mypy: str):
@nox.session(python=False)
def test(session: Session):
session.run("pytest", "tests")


@nox.session(reuse_venv=True)
def test_for_ci(session: Session):
session.install(
"coverage[toml]",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"pytest-timeout",
)
test(session)
47 changes: 35 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
[project]
name = "fluentmap"
description = "Drop-in replacement for Python map with concurrency support"
authors = [{ name = "Leavers", email = "[email protected]" }]
description = "A drop-in Python map replacement featuring parallel and batch processing."
authors = [
{ name = "leavers" },
{ name = "Leavers", email = "[email protected]" },
]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
]
dependencies = []
requires-python = ">=3.8"
readme = "README.md"
Expand All @@ -23,16 +41,6 @@ excludes = ["tests"]
source = "file"
path = "fluentmap.py"

[tool.pdm.dev-dependencies]
dev = [
"autoflake>=2.3.1",
"mypy>=1.11.1",
"nox>=2024.4.15",
"pytest>=8.3.2",
"ruff>=0.6.1",
"rtoml>=0.11.0",
]

[tool.autoflake]
in-place = true
recursive = true
Expand Down Expand Up @@ -62,3 +70,18 @@ warn_unused_configs = true

[tool.pytest.ini_options]
asyncio_mode = "strict"

[dependency-groups]
dev = [
"autoflake>=2.3.1",
"coverage[toml]>=7.6.1",
"mypy>=1.11.1",
"nox>=2024.4.15",
"pytest>=8.3.2",
"pytest-asyncio>=0.23.8",
"pytest-cov>=5.0.0",
"pytest-mock>=3.14.0",
"pytest-timeout>=2.3.1",
"ruff>=0.6.1",
"rtoml>=0.11.0",
]

0 comments on commit ab65ee0

Please sign in to comment.