Skip to content

Commit

Permalink
Merge pull request #6 from SingularityX-ai/bug/fix-enumerate
Browse files Browse the repository at this point in the history
Bug/fix enumerate
  • Loading branch information
sumansaurabh authored Jun 6, 2024
2 parents 0b9afef + 881d291 commit 1a453eb
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 79 deletions.
72 changes: 36 additions & 36 deletions .github/workflows/apidocs.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: apidocs
on:
- push
# name: apidocs
# on:
# - push

jobs:
deploy:
runs-on: ubuntu-latest
# jobs:
# deploy:
# runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
# steps:
# - uses: actions/checkout@master
# - name: Set up Python 3.8
# uses: actions/setup-python@v2
# with:
# python-version: 3.8

- name: Install requirements for documentation generation
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install pytest pydoctor>=22.3.0 .
# - name: Install requirements for documentation generation
# run: |
# python -m pip install --upgrade pip setuptools wheel
# python -m pip install pytest pydoctor>=22.3.0 .

- name: Generate API documentation with pydoctor
run: |
# - name: Generate API documentation with pydoctor
# run: |

# Run simple pydoctor build
pydoctor \
--project-name=PyDocSmith \
--project-url=https://github.com/$GITHUB_REPOSITORY \
--html-viewsource-base=https://github.com/$GITHUB_REPOSITORY/tree/$GITHUB_SHA \
--make-html \
--html-output=./apidocs \
--project-base-dir="." \
--docformat=restructuredtext \
--system-class=PyDocSmith.tests._pydoctor.HidesTestsPydoctorSystem \
--intersphinx=https://docs.python.org/3/objects.inv \
./PyDocSmith
# # Run simple pydoctor build
# pydoctor \
# --project-name=PyDocSmith \
# --project-url=https://github.com/$GITHUB_REPOSITORY \
# --html-viewsource-base=https://github.com/$GITHUB_REPOSITORY/tree/$GITHUB_SHA \
# --make-html \
# --html-output=./apidocs \
# --project-base-dir="." \
# --docformat=restructuredtext \
# --system-class=PyDocSmith.tests._pydoctor.HidesTestsPydoctorSystem \
# --intersphinx=https://docs.python.org/3/objects.inv \
# ./PyDocSmith

- name: Push API documentation to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.PYDOCSMITH_DEPLOY }}
publish_dir: ./apidocs
commit_message: "Generate API documentation"
# - name: Push API documentation to Github Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.PYDOCSMITH_DEPLOY }}
# publish_dir: ./apidocs
# commit_message: "Generate API documentation"
82 changes: 41 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
name: Build
# name: Build

on: [push, pull_request]
# on: [push, pull_request]

env:
PYTHONIOENCODING: "utf-8"
# env:
# PYTHONIOENCODING: "utf-8"

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-20.04, macOS-10.15, windows-2019]
os: [ubuntu-20.04]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", 3.11, 3.12.0-rc.2]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install poetry
poetry install -v
- name: Run tests
run: poetry run pytest
# jobs:
# build:
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# # os: [ubuntu-20.04, macOS-10.15, windows-2019]
# os: [ubuntu-20.04]
# python-version: [3.6, 3.7, 3.8, 3.9, "3.10", 3.11, 3.12.0-rc.2]
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python3 -m pip install poetry
# poetry install -v
# - name: Run tests
# run: poetry run pytest

style:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python3 -m pip install poetry
poetry install -v
- name: Run linters
run: poetry run pre-commit run -a
# style:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: 3.9
# - name: Install dependencies
# run: |
# python3 -m pip install poetry
# poetry install -v
# - name: Run linters
# run: poetry run pre-commit run -a
2 changes: 1 addition & 1 deletion PyDocSmith/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def format_docstring_to_pep257(docstring: Docstring, width: int = 72) -> Docstri
if meta.description:
# Ensure meta descriptions are wrapped according to PEP 8
split_description = meta.description.split("\n")
for itm, idx in enumerate(split_description):
for idx, itm in enumerate(split_description):
split_description[idx] = textwrap.fill(itm.strip(), width)

meta.description = "\n".join(split_description)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="PyDocSmith",
version="0.1.4",
version="0.1.5",
description="It parses and composes docstrings in Google, Numpydoc, ReST and Epydoc.",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 1a453eb

Please sign in to comment.