From 82d158ad13f8c98402dbafc1cade47d2726ea677 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 13:34:54 +0000 Subject: [PATCH] Update README with testing options and setup CI/docs --- .github/workflows/docs.yml | 29 +++++++++++++++++++++++++++ .github/workflows/python-package.yml | 30 ++++++++++++++++++++++++++++ README.md | 16 ++++++++++----- docs/api.md | 3 +++ mkdocs.yml | 2 ++ pyproject.toml | 1 + 6 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/python-package.yml create mode 100644 docs/api.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..fa156a8 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,29 @@ +name: Publish docs via GitHub Pages + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -e ".[dev]" + - name: Configure Git user + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + - name: Deploy to GitHub Pages + run: mkdocs gh-deploy --force diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..824d071 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,30 @@ +name: Python package + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e ".[dev]" + - name: Test with pytest + run: | + pytest diff --git a/README.md b/README.md index acc2be4..15cc414 100644 --- a/README.md +++ b/README.md @@ -34,20 +34,26 @@ The `did` library provides a framework for managing and querying data that is or source venv/bin/activate # On Windows, use `venv\Scripts\activate` ``` -3. **Install the required dependencies:** +3. **Install the package and dependencies:** ```bash - pip install -r requirements.txt + pip install -e ".[dev]" ``` ### Running the Tests -To run the test suite, use the following command: +You can run the tests using either `pytest` (if you installed the development dependencies) or the standard `unittest` module. +**Using pytest (Recommended for development):** ```bash -find . -name "test_*.py" -exec python -m unittest {} + +pytest ``` -This will discover and run all the tests in the `tests` directory. +**Using unittest (Standard):** +```bash +python -m unittest discover tests +``` + +Both commands will discover and run all the tests in the `tests` directory. ## Documentation diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..6d2ce7a --- /dev/null +++ b/docs/api.md @@ -0,0 +1,3 @@ +# API Reference + +Coming soon. diff --git a/mkdocs.yml b/mkdocs.yml index e49e3f2..f353149 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,6 @@ site_name: DID-Python +theme: + name: material nav: - Home: index.md - API Reference: api.md diff --git a/pyproject.toml b/pyproject.toml index a419742..86d7714 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ dev = [ "mkdocs", "mkdocs-material", "mkdocstrings[python]", + "pytest", ] [tool.setuptools]