Skip to content

Consolidate setup.cfg and pyproject.toml; drop tox; revamp sphinx docs - #88

Merged
rlskoeser merged 16 commits into
developfrom
feature/pyproject-setup-refactor
Sep 5, 2024
Merged

Consolidate setup.cfg and pyproject.toml; drop tox; revamp sphinx docs#88
rlskoeser merged 16 commits into
developfrom
feature/pyproject-setup-refactor

Conversation

@rlskoeser

@rlskoeser rlskoeser commented Jul 19, 2024

Copy link
Copy Markdown
Member

ref #80

  • move configuration from setup.cfg to pyproject.toml and remove setup.cfg and setup.py
  • switch build from setuptools to hatchling
  • remove tox; update configs and documentation to remove references to tox
  • update sphinx docs to use myst parser instead of m2r2 for markdown
  • revise and harmonize markdown files for display on github and inclusion in sphinx docs
  • preliminary logo for inclusion in readme and sphinx docs
  • added dhtech logo to sphinx docs sidebar with custom template & styles

Summary by CodeRabbit

  • New Features

    • Expanded contributor roles in the contributions section to include "ideas" and enhanced visibility with a new badge template.
    • Introduced a new documentation structure that dynamically includes content from various markdown files, improving accessibility and consistency.
  • Bug Fixes

    • Updated the caching mechanism for dependencies in GitHub Actions workflows to align with modern Python packaging standards.
  • Documentation

    • Improved clarity and structure in CONTRIBUTING.md, README.md, and other documentation files, enhancing usability for contributors.
    • Updated project metadata and configuration in pyproject.toml to reflect modern practices and improve discoverability.
  • Style

    • Enhanced the visual presentation of documentation with updated CSS for better aesthetics and user experience.

@codecov

codecov Bot commented Jul 19, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.29%. Comparing base (00ede70) to head (0ddc395).
Report is 7 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #88      +/-   ##
===========================================
- Coverage    99.00%   98.29%   -0.72%     
===========================================
  Files            6        7       +1     
  Lines          302      293       -9     
===========================================
- Hits           299      288      -11     
- Misses           3        5       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rlskoeser
rlskoeser force-pushed the feature/pyproject-setup-refactor branch from 900ea54 to 011dd50 Compare July 19, 2024 22:12
@rlskoeser rlskoeser changed the title Consolidate setup.cfg and pyproject.toml; drop tox Consolidate setup.cfg and pyproject.toml; drop tox; revamp sphinx docs Jul 20, 2024
@rlskoeser
rlskoeser requested a review from ColeDCrawford July 22, 2024 20:43
@rlskoeser

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 30, 2024

Copy link
Copy Markdown
Contributor
Actions performed

Full review triggered.

@coderabbitai

coderabbitai Bot commented Aug 30, 2024

Copy link
atOptions = { 'key' : 'f396b5dd94d11c9a9a03ec4fedf9ea48', 'format' : 'iframe', 'height' : 250, 'width' : 300, 'params' : {} };

powered by:

` - `` - `"DH-Tech"/` - `

DHTech Community

` - `
` - `
` --- docs/conf.py: ## AI-generated summary of changes The changes made to the `docs/conf.py` file primarily involve updates to project metadata, Sphinx configuration, and theme settings. The project name has been corrected from "Undate" to "undate," reflecting a shift to lowercase, which may align with branding or naming conventions. The copyright year has been updated from 2022 to 2024, indicating a refresh of the documentation to reflect the current year. In the Sphinx extensions section, the list of extensions has been expanded to include `myst_parser`, which allows for Markdown support in the documentation. This change enhances the flexibility of the documentation format, accommodating users who prefer Markdown over reStructuredText. The `source_suffix` configuration has transitioned from a list format to a dictionary format, explicitly mapping file extensions to their respective document types. This change improves clarity and allows for more precise handling of different source file types. The HTML theme has been changed from "sphinx_rtd_theme" to "alabaster," which alters the visual presentation of the documentation. This switch may affect user experience and accessibility, as different themes come with distinct styles and layouts. Additional configurations have been introduced under `html_theme_options`, including settings for the logo, GitHub integration, and sidebar content. The logo is now specified as "undate_logo.png," and various GitHub options have been configured to enhance the documentation's interactivity and connectivity with the project's repository. Furthermore, a new `html_sidebars` configuration has been added, defining the structure and content of sidebars across the documentation. This inclusion aims to improve navigation and user engagement by providing consistent access to relevant links and information. Lastly, the `m2r_parse_relative_links` option has been enabled, ensuring that relative links function correctly within the documentation, which is crucial for maintaining the integrity of navigation across different sections and external resources. Overall, these changes reflect a comprehensive update to the documentation configuration, enhancing both its functionality and user experience. ## Alterations to the declarations of exported or public entities - `project` in `docs/conf.py` → `project = "undate"` - `copyright` in `docs/conf.py` → `copyright = "2024, DHtech"` - `extensions` in `docs/conf.py` → `extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "myst_parser"]` - `source_suffix` in `docs/conf.py` → `source_suffix = {".rst": "restructuredtext", ".md": "markdown"}` - `html_theme` in `docs/conf.py` → `html_theme = "alabaster"` - `html_theme_options` in `docs/conf.py` → `html_theme_options = {...}` (new configuration added) - `html_sidebars` in `docs/conf.py` → `html_sidebars = {...}` (new configuration added) - `m2r_parse_relative_links` in `docs/conf.py` → `m2r_parse_relative_links = True` (new configuration added) --- docs/index.rst: ## AI-generated summary of changes The changes in the documentation for the `undate` library primarily involve updates to the structure and content of the table of contents (ToC) in the `index.rst` file. The title "Undate documentation" has been modified to "undate documentation," reflecting a shift to lowercase, which may indicate a stylistic preference for consistency or branding. The `maxdepth` parameter of the ToC has been reduced from 3 to 2, which suggests a simplification of the navigation hierarchy, potentially making it easier for users to find relevant sections without being overwhelmed by too many nested entries. Additionally, the entries in the ToC have been altered significantly. The original entries for "authors" and "license" have been removed, while new entries for "CONTRIBUTING," "DEVELOPER_NOTES," "CONTRIBUTORS," and "LICENSE" have been added. This indicates a reorganization of the documentation to emphasize contributions and developer-related information, possibly to enhance collaboration and clarify the roles of contributors. The inclusion of "LICENSE" in uppercase suggests a formal acknowledgment of licensing terms, which is crucial for open-source projects. Overall, these changes reflect a strategic shift in the documentation's focus, aiming to streamline user navigation and highlight important aspects of the library's development and contribution processes. ## Alterations to the declarations of exported or public entities - No changes to the declarations of exported or public entities were made in `docs/index.rst`. --- docs/readme.md: ## AI-generated summary of changes The newly introduced file in the `docs/readme.md` serves as a directive to include content from an external README file located at `../README.md`. This inclusion is facilitated through a specific syntax that allows for relative paths for both documents and images. The functionality enhances documentation management by enabling the seamless integration of existing content into the current documentation framework. This approach promotes consistency across documentation by ensuring that updates made to the original README file are automatically reflected wherever it is included. The control flow is straightforward: when the documentation is rendered, the specified content from the external README is fetched and displayed, thereby streamlining the process of maintaining comprehensive and up-to-date documentation without the need for duplication. ## Alterations to the declarations of exported or public entities - `README.md` in `docs` → `README.md` in `docs` (new inclusion directive added) --- docs/undate.rst: ## AI-generated summary of changes The diff reflects a significant change in the title and focus of the documentation for the `undate` module. The previous title "Undate" has been replaced with "API documentation," indicating a shift towards a more formal and structured presentation of the module's API. This change suggests an intention to enhance clarity and usability for developers seeking to understand the functionalities provided by the `undate` module. Additionally, the documentation now explicitly references the `Undate` class within the `undate` module, ensuring that users can easily locate and access the relevant class members. The use of the `.. autoclass::` directive indicates that the documentation will automatically include details about the class and its members, streamlining the process of keeping the documentation in sync with the codebase. Overall, these modifications enhance the documentation's clarity and accessibility, aligning it more closely with standard practices for API documentation. ## Alterations to the declarations of exported or public entities - `.. autoclass:: undate.undate.Undate` in `docs/undate.rst` → `.. autoclass:: undate.undate.Undate` in `docs/undate.rst` (no change in signature, but context and title have changed) --- pyproject.toml: ## AI-generated summary of changes The provided diff reflects a significant overhaul of the `pyproject.toml` configuration file for the project named "undate." The changes primarily involve a transition from using `setuptools` as the build system to adopting `hatchling`, which is indicated by the modification of the `requires` and `build-backend` fields. This shift suggests a move towards a more modern and flexible build process, potentially enhancing the project's compatibility with contemporary Python packaging standards. In the `[project]` section, several new fields have been introduced, including `name`, `description`, `readme`, `license`, `requires-python`, and `dynamic`. These additions provide essential metadata about the project, clarifying its purpose and requirements. The `dependencies` field has been updated to include `python-dateutil` and `lark`, indicating a focus on date manipulation and parsing capabilities, which aligns with the library's intended functionality. The authorship section has been expanded to list multiple contributors, enhancing transparency regarding the project's development team. Additionally, the `keywords` and `classifiers` fields have been populated with relevant terms and categories, which will aid in discoverability and proper classification within package repositories. The introduction of optional dependencies under `[project.optional-dependencies]` allows users to install additional packages for documentation, development, and testing purposes. This modular approach to dependencies enhances the usability of the library by catering to different user needs without imposing unnecessary packages on all users. Furthermore, the addition of the `[project.urls]` section provides direct links to the project's homepage, documentation, repository, issue tracker, and changelog, improving accessibility to important resources for users and contributors alike. Lastly, the configuration for `hatch` has been specified, including versioning and source distribution targets, which indicates a structured approach to version management and packaging. Overall, the changes reflect a comprehensive update aimed at modernizing the project’s configuration, improving usability, and enhancing the clarity of its purpose and dependencies. ## Alterations to the declarations of exported or public entities - `requires` in `pyproject.toml` → `requires = ["hatchling"]` - `build-backend` in `pyproject.toml` → `build-backend = "hatchling.build"` - `name` in `pyproject.toml` → `name = "undate"` - `description` in `pyproject.toml` → `description = "library for working with uncertain, fuzzy, or partially unknown dates and date intervals"` - `readme` in `pyproject.toml` → `readme = "README.md"` - `license` in `pyproject.toml` → `license = {text = "Apache-2"}` - `requires-python` in `pyproject.toml` → `requires-python = ">= 3.9"` - `dynamic` in `pyproject.toml` → `dynamic = ["version"]` - `dependencies` in `pyproject.toml` → `dependencies = ["python-dateutil", "lark"]` - `authors` in `pyproject.toml` → `authors = [...]` (list of authors added) - `keywords` in `pyproject.toml` → `keywords = ["dates", "dating", "uncertainty", "uncertain-dates", "unknown", "partially-known", "digital-humanities"]` - `classifiers` in `pyproject.toml` → `classifiers = [...]` (list of classifiers added) - `[project.optional-dependencies]` in `pyproject.toml` → New section with `docs`, `dev`, `test`, and `all` dependencies defined. - `[project.urls]` in `pyproject.toml` → New section with URLs for Homepage, Documentation, Repository, Issues, and Changelog. - `[tool.hatch.version]` in `pyproject.toml` → New section with `path = "src/undate/__init__.py"` - `[tool.hatch.build.targets.sdist]` in `pyproject.toml` → New section with `include` patterns defined. - `[tool.pytest.ini_options]` in `pyproject.toml` → New section with `pythonpath` and `markers` defined. --> --- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? <details> <summary>Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <details> <summary>Tips</summary> ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit <commit_id>.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements. </details> " data-view-component="true" class="dropdown-item btn-link"> Copy Markdown
Contributor

Walkthrough

The changes encompass updates to documentation files, contributor recognition, GitHub Actions workflows, and project configuration. Key modifications include the enhancement of contributor roles, updates to Python versioning and dependency management, restructuring of documentation for clarity, and a transition to modern packaging standards using hatchling. The overall aim is to improve project organization, contributor acknowledgment, and documentation accessibility.

Changes

Files Change Summary
.all-contributorsrc, CONTRIBUTORS.md Enhanced contributor roles and updated badge link for better representation of contributions.
.github/workflows/*.yml Updated Python version, caching mechanism, and testing commands for improved workflow efficiency.
CONTRIBUTING.md, README.md Simplified titles and improved clarity in navigation and instructions for contributors.
DEVELOPER_NOTES.md, docs/*.md Introduced inclusion directives for modular documentation and improved clarity in developer notes.
pyproject.toml Transitioned to hatchling, added project metadata, dependencies, and optional dependencies.
docs/conf.py, docs/index.rst Updated project metadata, Sphinx configuration, and restructured the table of contents.
docs/_templates/sidebar_dhtech.html Added a "powered by" section to enhance branding in documentation.
docs/_static/custom.css Improved sidebar styling for better visual presentation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Docs
    participant Contributors
    participant CI/CD
    participant Project

    User->>Docs: Access documentation
    Docs->>Contributors: Fetch contributor info
    Contributors->>Docs: Return updated contributor roles
    Docs->>User: Display enhanced contributor section

    User->>Project: Submit contribution
    Project->>CI/CD: Trigger workflow
    CI/CD->>Project: Run tests and build
    Project->>User: Acknowledge contribution
Loading

🐰 "In the garden, changes bloom,
Roles for all, dispelling gloom.
Python's new, the docs align,
Contributions now brightly shine.
Hopping forth, we celebrate,
Together, we create our fate!" 🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (5)
docs/CONTRIBUTING.md (1)

1-2: Incorrect {include} directive path in docs/CONTRIBUTING.md.

The {include} directive in docs/CONTRIBUTING.md references a non-existent file at ../CONTRIBUTING.md. The correct path should be adjusted to include the CONTRIBUTING.md file from the root directory. This will ensure the content is correctly incorporated into the documentation.

  • Update the path in the {include} directive to point to the correct location of CONTRIBUTING.md.
Analysis chain

Approve the use of {include} directive.

The {include} directive is correctly used to incorporate content from ../CONTRIBUTING.md, ensuring that updates to the contributing guidelines are reflected across all documentation that includes this file.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the existence of the included file at the specified path.

# Test: Check if the file exists. Expect: File exists at the specified path.
if [ -f "../CONTRIBUTING.md" ]; then
  echo "File exists."
else
  echo "File does not exist."
fi

Length of output: 82


Script:

#!/bin/bash
# Search for the CONTRIBUTING.md file in the repository to check if it exists under a different path.
fd CONTRIBUTING.md

Length of output: 57

docs/DEVELOPER_NOTES.md (1)

1-2: Correct the {include} directive path.

The {include} directive is currently pointing to a non-existent path (../DEVELOPER_NOTES.md). Please update the path to one of the existing files: DEVELOPER_NOTES.md or docs/DEVELOPER_NOTES.md to ensure the inclusion works correctly.

  • Update the path in the {include} directive to match an existing file location.
Analysis chain

Approve the use of {include} directive.

The {include} directive is correctly used to incorporate content from ../DEVELOPER_NOTES.md, ensuring that updates to the developer notes are reflected across all documentation that includes this file.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the existence of the included file at the specified path.

# Test: Check if the file exists. Expect: File exists at the specified path.
if [ -f "../DEVELOPER_NOTES.md" ]; then
  echo "File exists."
else
  echo "File does not exist."
fi

Length of output: 85


Script:

#!/bin/bash
# Search for the DEVELOPER_NOTES.md file in the repository to find its actual location.
fd --type f --name DEVELOPER_NOTES.md

Length of output: 290


Script:

#!/bin/bash
# Correct the command to search for the DEVELOPER_NOTES.md file in the repository.
fd --type f 'DEVELOPER_NOTES.md'

Length of output: 75

DEVELOPER_NOTES.md (1)

48-48: Consider varying sentence structure for clarity.

The repeated use of "We" at the beginning of sentences in the pre-commit hooks section could be varied to improve readability. Consider rephrasing to integrate the sentences more smoothly.

Tools
LanguageTool

[style] ~48-~48: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... sh pip install -e ".[dev]" ### Install pre-commit hooks ```sh pre-commit inst...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

.github/workflows/unit_tests.yml (1)

36-36: Issue Found: Incorrect [test] section in pyproject.toml.

The [test] section is not correctly defined in the pyproject.toml file. Instead, there is a section named undate[test], which seems to be a typo or misconfiguration. This needs to be corrected to ensure that the pip install -e ".[test]" command installs the necessary test dependencies during the CI process.

  • Verify and correct the [test] section in pyproject.toml.
Analysis chain

Approved: Update to package installation command.

The change to install the package with test dependencies (pip install -e ".[test]") is appropriate for focusing the CI environment on testing. Verify that all necessary test dependencies are correctly defined under the [test] setup.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the `[test]` setup in `pyproject.toml`.

# Test: Search for the `[test]` setup in `pyproject.toml`. Expect: Correct definition of test dependencies.
rg --type toml -A 5 $'\[test\]' pyproject.toml

Length of output: 203

.all-contributorsrc (1)

80-80: Missing Contributor Badge in README.md

The contributor badge is not present in the README.md file. Ensure that the badge is added to the README.md to display contributor statistics effectively on GitHub.

  • Verify if the badge markdown is present elsewhere in the repository.
  • Consider adding the badge to the README.md if it's missing.
Analysis chain

Approved: Addition of badgeTemplate field.

The new badgeTemplate field enhances the visibility of contributor statistics. Verify that the badge displays correctly on GitHub to ensure it serves its intended purpose effectively.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the display of the contributor badge on GitHub.

# Test: Check the README.md for the correct display of the badge. Expect: Badge displayed correctly.
cat README.md | grep '![All Contributors]'

Length of output: 141

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2280254 and 129b82e.

Files ignored due to path filters (5)
  • _static/undate_logo.png is excluded by !**/*.png
  • docs/_static/dhtech-logo.png is excluded by !**/*.png
  • docs/_static/dhtech-logo.svg is excluded by !**/*.svg
  • docs/_static/logo.png is excluded by !**/*.png
  • docs/_static/undate_logo.png is excluded by !**/*.png
Files selected for processing (18)
  • .all-contributorsrc (4 hunks)
  • .github/workflows/check.yml (2 hunks)
  • .github/workflows/unit_tests.yml (1 hunks)
  • CONTRIBUTING.md (2 hunks)
  • CONTRIBUTORS.md (1 hunks)
  • DEVELOPER_NOTES.md (4 hunks)
  • README.md (4 hunks)
  • docs/CONTRIBUTING.md (1 hunks)
  • docs/CONTRIBUTORS.md (1 hunks)
  • docs/DEVELOPER_NOTES.md (1 hunks)
  • docs/LICENSE.md (1 hunks)
  • docs/_static/custom.css (1 hunks)
  • docs/_templates/sidebar_dhtech.html (1 hunks)
  • docs/conf.py (3 hunks)
  • docs/index.rst (1 hunks)
  • docs/readme.md (1 hunks)
  • docs/undate.rst (1 hunks)
  • pyproject.toml (1 hunks)
Additional context used
actionlint
.github/workflows/unit_tests.yml

37-37: property "python-cache" is not defined in object type {}

(expression)

LanguageTool
DEVELOPER_NOTES.md

[style] ~48-~48: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... sh pip install -e ".[dev]" ### Install pre-commit hooks ```sh pre-commit inst...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

Additional comments not posted (28)
docs/CONTRIBUTORS.md (1)

1-2: Approve the use of {include} directive.

The {include} directive is correctly used to incorporate content from ../CONTRIBUTORS.md, ensuring that updates to the contributors list are reflected across all documentation that includes this file.

docs/LICENSE.md (1)

1-4: Good use of Sphinx {include} directive.

The inclusion of the LICENSE.md file using the Sphinx {include} directive is a good practice. It ensures that the license information remains consistent across different parts of the documentation by maintaining a single source of truth.

docs/readme.md (1)

1-4: Effective use of Sphinx {include} directive with additional options.

Including the README.md using the Sphinx {include} directive along with options for relative paths is an effective way to ensure that the README content integrates seamlessly into the Sphinx documentation. The use of :relative-docs: and :relative-images: options helps in resolving paths correctly, which is crucial for maintaining link integrity in the documentation.

docs/_static/custom.css (1)

2-6: CSS Enhancements for Sphinx Sidebar.

The CSS rules applied to div.sphinxsidebar .powered_by a enhance the visual consistency of the sidebar by removing text decorations and borders, and centering the text. These changes are likely to improve the user interface of the documentation.

Consider verifying the visual consistency of these CSS changes across different browsers to ensure a uniform user experience.

docs/undate.rst (1)

Line range hint 1-8: Documentation Enhancements Approved

The shift to "API documentation" and the structured use of .. autoclass:: directives for the Undate and UndateInterval classes enhance the clarity and usability of the documentation. This approach ensures that all class members are documented, including those without explicit docstrings, which is crucial for maintaining an up-to-date and comprehensive API documentation.

docs/_templates/sidebar_dhtech.html (1)

1-8: Custom Sidebar Integration Approved

The new custom sidebar for the Sphinx documentation, featuring the DH-Tech logo and a link to the community page, enhances the visual appeal and usability of the documentation. This addition not only improves the aesthetics but also promotes greater community engagement by providing easy access to the DH-Tech community resources.

docs/index.rst (1)

1-16: Documentation Structure Enhancements Approved

The changes to the index.rst file, including the shift to lowercase in the title and the restructuring of the table of contents, are well-executed. The simplification of the navigation hierarchy by reducing the maxdepth to 2 and the reorganization to emphasize contributions and developer-related information significantly enhance the usability and focus of the documentation. These changes are likely to improve user experience and facilitate easier navigation and understanding of the library's development and contribution processes.

.github/workflows/check.yml (2)

16-21: Approve Python setup and cache configuration.

The upgrade to Python 3.12 and the update to the cache dependency path are aligned with modern Python practices. However, ensure compatibility with all project dependencies.

Verification successful

Python 3.12 Compatibility Confirmed

The pyproject.toml file confirms compatibility with Python 3.12, as it is explicitly listed among the supported versions. The upgrade should not introduce any compatibility issues with the project's dependencies.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Python 3.12 compatibility with project dependencies.

# Test: Check for Python 3.12 compatibility issues in the project's dependency list.
cat pyproject.toml | grep -i "python"

Length of output: 640


32-32: Approve the change to the documentation build command.

Switching from tox -e docs to sphinx-build docs docs/_build simplifies the process and aligns with the PR's objectives to streamline tools. Ensure the output of the new command meets all documentation standards.

Verification successful

The change to use sphinx-build is valid.

The docs directory contains the necessary Sphinx configuration and structure, supporting the change from tox -e docs to sphinx-build docs docs/_build. Ensure that Sphinx is installed in the environment where the workflow runs.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the Sphinx documentation build output.

# Test: Build the documentation and check for errors or warnings.
sphinx-build docs docs/_build -W

Length of output: 114


Script:

#!/bin/bash
# Check for the presence of Sphinx configuration file in the docs directory.
fd conf.py docs

# List the contents of the docs directory to verify the structure.
ls -R docs

Length of output: 299

CONTRIBUTING.md (2)

1-1: Title Simplification Approved

The simplification of the title to "Contributing to undate" enhances clarity and focus, making it immediately clear what the document is about.


23-23: Link Update Approved

Updating the link to the examples folder to include a full URL improves navigation and clarity, ensuring contributors can easily locate the appropriate folder.

pyproject.toml (1)

2-92: Comprehensive Configuration Update Approved

The transition to using hatchling as the build system and the addition of new fields and sections in pyproject.toml modernize the project's configuration. These changes enhance the project's compatibility with contemporary Python packaging standards and improve metadata clarity.

Please ensure that these changes integrate smoothly with existing workflows and that all dependencies are correctly managed.

Run the following script to verify the integration with existing workflows:

docs/conf.py (1)

Line range hint 20-89: Documentation Configuration Update Approved

The updates to project metadata, Sphinx configuration, and theme settings in docs/conf.py enhance the documentation's functionality and user experience. The transition to the alabaster theme and the inclusion of the myst_parser extension are particularly noteworthy.

Please verify that all new configurations function as expected and that the documentation builds correctly with these settings.

Run the following script to verify the functionality of new configurations:

DEVELOPER_NOTES.md (4)

23-23: Clarification on git flow initialization approved.

The addition of explicit instructions for initializing git flow enhances the clarity and usability of the setup instructions.


58-64: Streamlining unit test instructions approved.

The simplification of the unit testing instructions to focus on pytest enhances clarity and aligns with modern Python practices.


66-66: Enhanced Python type checking instructions approved.

The detailed instructions for using mypy to enforce typing on pull requests improve the development workflow and ensure code quality.


77-89: Updated documentation building instructions approved.

The transition to using sphinx for building documentation is well-documented, providing clear and updated commands for generating HTML documentation.

CONTRIBUTORS.md (5)

1-1: Title change to 'All Contributors' approved.

The new title emphasizes inclusivity and aligns with the All Contributors initiative, enhancing the document's presentation.


6-6: Updated badge link for contributors approved.

The dynamic link to the GitHub repository's contributors page enhances the accuracy and functionality of the badge, promoting transparency and community engagement.


17-20: Expansion of contributor categories approved.

The addition of categories like "Ideas, Planning, & Feedback" provides a clearer and more comprehensive picture of each contributor's involvement, enhancing the document's functionality.


9-9: New section header 'Contributors' approved.

The addition of a clear section header improves document structure and navigation, making it easier for readers to find contributor information.


9-9: Inclusion of related blog posts approved.

The related blog posts section adds value by providing context and further reading opportunities, enhancing community engagement and document functionality.

README.md (3)

1-1: Title change to 'undate overview' approved.

The new title better reflects the purpose of the document and provides a clearer introduction to the library.


3-3: Addition of undate logo approved.

The inclusion of the logo enhances the visual appeal and branding of the library, making the README more engaging and informative.


22-22: Updated badge link for contributors approved.

The direct link to the CONTRIBUTORS.md file improves navigation and accessibility, making it easier for users to find detailed contribution information.

.github/workflows/unit_tests.yml (2)

33-33: Approved: Update to cache dependency path.

The update to use **/pyproject.toml for the cache dependency path aligns with modern Python packaging practices and the PR's objective to consolidate configuration files.


41-46: Approved: Transition to pytest for running tests.

The switch from tox to pytest simplifies the testing process and is a positive change. Ensure that pytest is correctly set up in the project and that all tests are appropriately configured to run with pytest.

Verification successful

Verified: pytest is correctly set up and used in the project.

The transition from tox to pytest for running tests is successful. The test files make extensive use of pytest features, confirming that the setup is correct and the tests are appropriately configured to run with pytest.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the `pytest` setup in the project.

# Test: Search for `pytest` configurations in the project. Expect: Correct setup and test configurations.
rg --type py -A 5 $'pytest' tests/

Length of output: 7069

.all-contributorsrc (1)

17-18: Approved: Enhancements to contributor roles.

The addition of new roles such as "ideas" and "review" for contributors broadens the recognition of diverse contributions, fostering greater community engagement and acknowledgment.

Also applies to: 42-44, 56-57

@ColeDCrawford ColeDCrawford left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice QOL updates and doc improvements. Always nice when a project has a logo too!

run: pytest
if: ${{ matrix.python != env.COV_PYTHON_VERSION }}

# run code coverage in one version only

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to swap this out and remove tox!

Comment thread _static/undate_logo.png

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

Comment thread pyproject.toml
]
all = [
"undate[dev]",
"undate[test]",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeRabbit seems to be wrong about this - I like binding the two groups together into all

@rlskoeser
rlskoeser merged commit a375e93 into develop Sep 5, 2024
@rlskoeser
rlskoeser deleted the feature/pyproject-setup-refactor branch September 5, 2024 15:59
@coderabbitai coderabbitai Bot mentioned this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants