Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changes here will be overwritten by Copier
_commit: 2d0c192
_src_path: https://github.com/python-project-templates/base.git
add_docs: false
add_extension: python
add_wiki: true
email: OpenSource@point72.com
github: Point72
project_description: Reactive chat bot framework
project_name: csp bot
python_version_primary: '3.9'
team: Point72, L.P.
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at CSPOpenSource@point72.com. All
reported by contacting the project team at OpenSource@point72.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
30 changes: 15 additions & 15 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# version: 2
# updates:
# - package-ecosystem: "github-actions"
# directory: "/"
# schedule:
# interval: "weekly"
# labels:
# - "part: github_actions"
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "part: github_actions"

# - package-ecosystem: "pip"
# directory: "/"
# schedule:
# interval: "monthly"
# labels:
# - "lang: python"
# - "part: dependencies"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
labels:
- "lang: python"
- "part: dependencies"
9 changes: 3 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions-ext/python/setup@main
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
version: ${{ matrix.python-version }}

- name: Install dependencies
run: make develop
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/copier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Copier Updates

on:
workflow_dispatch:
schedule:
- cron: "0 5 * * 0"

jobs:
update:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions-ext/copier-update@main
with:
token: ${{ secrets.WORKFLOW_TOKEN }}
13 changes: 4 additions & 9 deletions .github/workflows/wiki.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Docs
name: Publish Wiki

on:
push:
Expand All @@ -20,13 +20,8 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Make home file
run: cp README.md docs/wiki/Home.md

- name: Upload Documentation to Wiki
uses: Andrew-Chen-Wang/github-wiki-action@v4
- uses: actions/checkout@v4
- run: cp README.md docs/wiki/Home.md
- uses: Andrew-Chen-Wang/github-wiki-action@v5
with:
path: docs/wiki
32 changes: 23 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ __pycache__/
*$py.class

# C extensions
*.a
*.so
*.obj
*.dll
*.exp
*.lib

# Distribution / packaging
.Python
Expand All @@ -29,8 +33,6 @@ share/python-wheels/
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

Expand Down Expand Up @@ -81,11 +83,7 @@ ipython_config.py
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
Expand Down Expand Up @@ -125,15 +123,31 @@ dmypy.json
.pyre/

# Documentation
docs/_build/
/site
index.md
docs/_build/
docs/src/_build/
docs/api
docs/index.md
_template/labextension
docs/html
docs/jupyter_execute
index.md

# JS
js/coverage
js/dist
js/lib
js/node_modules
js/*.tgz
csp_bot/extension

# Jupyter
.ipynb_checkpoints
.autoversion
!csp_bot/extension/csp_bot.json
!csp_bot/extension/install.json
csp_bot/nbextension
csp_bot/labextension

# Mac
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 the csp-bot authors
Copyright 2024 Point72, L.P.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,40 @@
.PHONY: develop build install

develop: ## install dependencies and build library
python -m pip install -e .[develop]
uv pip install -e .[develop]

requirements: ## install prerequisite python build requirements
python -m pip install --upgrade pip toml
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))'`
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print(" ".join(c["project"]["optional-dependencies"]["develop"]))'`

build: ## build the python library
python -m build -n

install: ## install library
python -m pip install .
uv pip install .

#########
# LINTS #
#########
.PHONY: lint lints fix format lint-py lint-docs fix-py fix-docs
.PHONY: lint-py lint-docs fix-py fix-docs lint lints fix format

lint-py: ## run python linter with ruff
lint-py: ## lint python with ruff
python -m ruff check csp_bot
python -m ruff format --check csp_bot

lint-docs: ## lint docs with mdformat and codespell
python -m mdformat --check docs/wiki/ README.md
python -m codespell_lib docs/wiki/ README.md
python -m mdformat --check README.md docs/wiki/
python -m codespell_lib README.md docs/wiki/

fix-py: ## fix python formatting with ruff
fix-py: ## autoformat python code with ruff
python -m ruff check --fix csp_bot
python -m ruff format csp_bot

fix-docs: ## autoformat docs with mdformat and codespell
python -m mdformat docs/wiki/ README.md
python -m codespell_lib --write docs/wiki/ README.md
python -m mdformat README.md docs/wiki/
python -m codespell_lib --write README.md docs/wiki/

# alias
lint: lint-py lint-docs ## run all linters
lints: lint
fix: fix-py fix-docs ## run all autoformatters
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<br/>

[![Build Status](https://github.com/point72/csp-bot/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/point72/csp-bot/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/point72/csp-bot/branch/main/graph/badge.svg)](https://codecov.io/gh/point72/csp-bot)
[![codecov](https://codecov.io/gh/Point72/csp-bot/branch/main/graph/badge.svg)](https://codecov.io/gh/Point72/csp-bot)
[![GitHub issues](https://img.shields.io/github/issues/point72/csp-bot.svg)](https://github.com/point72/csp-bot/issues)
[![PyPI](https://img.shields.io/pypi/l/csp-bot.svg)](https://pypi.python.org/pypi/csp-bot)
[![License](https://img.shields.io/github/license/Point72/csp-bot)](https://github.com/Point72/csp-bot)
[![PyPI](https://img.shields.io/pypi/v/csp-bot.svg)](https://pypi.python.org/pypi/csp-bot)

## Features
Expand Down
1 change: 0 additions & 1 deletion csp_bot/tests/test_all.py

This file was deleted.

34 changes: 20 additions & 14 deletions docs/wiki/contribute/Build-from-Source.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
`csp-bot` is written in Python and Javascript. While prebuilt wheels are provided for end users, it is also straightforward to build `csp-bot` from either the Python [source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/) or the GitHub repository.
`csp-bot` is written in Python. While prebuilt wheels are provided for end users, it is also straightforward to build `csp-bot` from either the Python [source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/) or the GitHub repository.

## Table of Contents

- [Table of Contents](#table-of-contents)
- [Make commands](#make-commands)
- [Prerequisites](#prerequisites)
- [Clone](#clone)
Expand All @@ -28,6 +25,8 @@ test run the tests

## Prerequisites

`csp-bot` has a few system-level dependencies which you can install from your machine package manager. Other package managers like `conda`, `nix`, etc, should also work fine.

## Clone

Clone the repo with:
Expand Down Expand Up @@ -59,32 +58,39 @@ make build

`csp-bot` has linting and auto formatting.

| Language | Linter | Autoformatter | Description |
| :------- | :--------- | :------------ | :---------- |
| Python | `ruff` | `ruff` | Style |
| Python | `ruff` | `ruff` | Imports |
| Markdown | `prettier` | `prettier` | Style |
| Language | Linter | Autoformatter | Description |
| :------- | :---------- | :------------ | :---------- |
| Python | `ruff` | `ruff` | Style |
| Markdown | `mdformat` | `mdformat` | Style |
| Markdown | `codespell` | | Spelling |

**Python Linting**

```bash
make lint
make lint-py
```

**Python Autoformatting**

```bash
make fix
make fix-py
```

**Documentation Linting**

We use `prettier` for our Markdown linting, so follow the above docs.
```bash
make lint-docs
```

**Documentation Autoformatting**

```bash
make fix-docs
```

## Testing

`csp-bot` has Python tests, which can be run via `pytest`.
First, install the Python development dependencies with
`csp-bot` has extensive Python tests. The tests can be run via `pytest`. First, install the Python development dependencies with

```bash
make develop
Expand Down
23 changes: 12 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ build-backend="hatchling.build"

[project]
name = "csp-bot"
authors = [{name = "the csp-bot authors", email = "CSPOpenSource@point72.com"}]
description = "CSP Bot"
authors = [{name = "Point72, L.P.", email = "OpenSource@point72.com"}]
description = "Reactive chat bot framework"
readme = "README.md"
license = { text = "Apache-2.0" }
version = "1.1.0"
Expand Down Expand Up @@ -49,26 +49,27 @@ develop = [
"build",
"bump-my-version",
"check-manifest",
"codespell>=2.2.6,<2.5",
"codespell>=2.4,<2.5",
"csp-adapter-discord>=0.1,<0.2",
"csp-adapter-slack>=0.3,<0.4",
"csp-adapter-symphony>=0.3,<0.4",
"hatchling",
"mdformat>=0.7.17,<0.8",
"mdformat-tables>=1,<1.1",
"mdformat>=0.7.22,<0.8",
"mdformat-tables>=1",
"pytest",
"pytest-cov",
"ruff>=0.5,<0.10",
"twine>=5,<7",
"ruff",
"twine",
"uv",
"wheel",
]

[project.scripts]
csp-bot-start = "csp_bot.cli:main"

[project.urls]
Repository = "https://github.com/point72/csp-bot"
Homepage = "https://github.com/point72/csp-bot"
Repository = "https://github.com/Point72/csp-bot"
Homepage = "https://github.com/Point72/csp-bot"

[tool.bumpversion]
current_version = "1.1.0"
Expand All @@ -88,6 +89,7 @@ replace = 'version = "{new_version}"'

[tool.check-manifest]
ignore = [
".copier-answers.yaml",
"Makefile",
"docs/**/*",
"example/**/*",
Expand Down Expand Up @@ -125,7 +127,6 @@ exclude = ["/docs", "/example"]

[tool.pytest.ini_options]
addopts = ["-vvv", "--junitxml=junit.xml"]
asyncio_mode = "strict"
testpaths = "csp_bot/tests"

[tool.ruff]
Expand All @@ -141,5 +142,5 @@ known-first-party = ["csp_bot"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]

[tool.ruff.lint.per-file-ignores]
"csp_bot/backends" = ["F401", "F403"]
"__init__.py" = ["F401", "F403"]
"csp_bot/backends" = ["F401", "F403"]
Loading