Skip to content

Conversation

qbey
Copy link
Member

@qbey qbey commented Mar 28, 2025

Add initial project structure with tests and configuration files:

  • ruff for format and linting
  • uv with hatch for packaging

@qbey qbey requested a review from Copilot March 28, 2025 22:43
@qbey qbey self-assigned this Mar 28, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request bootstraps the project structure and configuration for a new Django library.

  • Adds initial Django test project files, including settings, URL configuration, and a management script.
  • Introduces basic project configuration files for linting (ruff), packaging (hatch/uv), and continuous integration workflows.

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_project/urls.py Basic URL config file for the test Django project.
tests/test_project/settings.py Standard Django settings for testing with minimal configuration.
tests/test_project/manage.py Django management script file for the test project.
tests/test_project/init.py Package initialization for the test Django project.
tests/test_dummy.py A dummy test to validate the test suite functionality.
tests/init.py Initialization for the test suite.
src/lasuite/init.py Initialization for the main Django library package.
setup.py Minimal setup file for backward compatibility; primary settings in pyproject.toml.
pyproject.toml Main project configuration defining build system, dependencies, and linting settings.
gitlint/gitlint_emoji.py Extra Gitlint rule for enforcing commit title format with Gitmoji.
README.md Project readme with installation, development, and testing instructions.
CHANGELOG.md Changelog file based on Keep a Changelog format and Semantic Versioning.
.github/workflows/tests.yml GitHub Actions workflow configuration for linting, testing, and changelog checks.
.github/PULL_REQUEST_TEMPLATE.md PR template guiding contributors on providing purpose and proposals.
.github/ISSUE_TEMPLATE/Support_question.md Issue template for support questions.
.github/ISSUE_TEMPLATE/Feature_request.md Issue template for feature requests.
.github/ISSUE_TEMPLATE/Bug_report.md Issue template for bug reports.
.github/ISSUE_TEMPLATE.md Generic issue template with guidance to choose more specific templates.
Files not reviewed (2)
  • .gitlint: Language not supported
  • Makefile: Language not supported
Comments suppressed due to low confidence (1)

gitlint/gitlint_emoji.py:30

  • Consider adding a timeout parameter to the requests.get call to prevent the function from hanging if the Gitmoji service is unreachable.
gitmojis = requests.get("https://raw.githubusercontent.com/carloscuesta/gitmoji/master/packages/gitmojis/src/gitmojis.json").json()["gitmojis"]

@qbey qbey force-pushed the qbey/bootstrap-project branch 6 times, most recently from 8778ca6 to ba7435a Compare March 28, 2025 23:02
@qbey qbey marked this pull request as ready for review March 28, 2025 23:03
@qbey qbey requested a review from lunika March 28, 2025 23:03
@qbey
Copy link
Member Author

qbey commented Mar 28, 2025

@lunika This is empty but we could merge this as a first step.

@qbey qbey requested a review from Copilot March 28, 2025 23:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the initial project structure for the Django La Suite library, including test project files, configuration files for linting and packaging, and GitHub workflows for continuous integration.

  • Added Django test project files (settings, wsgi, manage, urls, and a dummy test)
  • Established build and lint configuration with pyproject.toml, setup.py, and GitHub Action workflows
  • Introduced supplementary files such as issue templates, a changelog, and a custom gitlint rule

Reviewed Changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_project/wsgi.py Django WSGI configuration for the test project
tests/test_project/urls.py Basic URL configuration (empty urlpatterns)
tests/test_project/settings.py Django settings with database, logging, and internationalization configurations
tests/test_project/manage.py Django management script
tests/test_project/init.py Package initializer for the test project
tests/test_dummy.py Dummy test to ensure the test suite is working
tests/init.py Test suite initializer
src/lasuite/init.py Library initializer for the Django La Suite package
setup.py Compatibility setup file for older tools
pyproject.toml Build and lint configurations for the project using hatch and ruff
gitlint/gitlint_emoji.py Custom gitlint rule to enforce commit title formatting with gitmoji
README.md Project documentation and quick start guide
CHANGELOG.md Changelog following the Keep a Changelog format
.github/workflows/tests.yml CI workflows for linting, testing, and code quality checks via GitHub Actions
.github/PULL_REQUEST_TEMPLATE.md PR template for contributors
.github/ISSUE_TEMPLATE/* Issue templates for support, feature requests, and bug reports
Files not reviewed (2)
  • .gitlint: Language not supported
  • Makefile: Language not supported

"https://raw.githubusercontent.com/carloscuesta/gitmoji/master/packages/gitmojis/src/gitmojis.json",
timeout=10,
).json()["gitmojis"]
emojis = [item["emoji"] for item in gitmojis]
Copy link

Copilot AI Mar 28, 2025

Choose a reason for hiding this comment

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

The regex pattern built from dynamically fetched emojis does not escape special regex characters present in some emojis, which might lead to unexpected behavior. Consider escaping each emoji using re.escape() before joining them into the pattern.

Suggested change
emojis = [item["emoji"] for item in gitmojis]
emojis = [re.escape(item["emoji"]) for item in gitmojis]

Copilot uses AI. Check for mistakes.

Copy link
Member

@lunika lunika left a comment

Choose a reason for hiding this comment

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

😍

pyproject.toml Outdated
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: Django",
"Framework :: Django :: 4.2",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",

This is the version used in the dependencies section.

@lunika
Copy link
Member

lunika commented Mar 29, 2025

Reading the hatch documentation, should we rely on it to run test and managed environments ?
See :

There is also an existing github action to use hatch.
I can do this modification in a new PR once this one merged.

WDYT ?

Add initial project structure with tests and configuration files:
 - ruff for format and linting
 - uv with hatch for packaging
@qbey qbey force-pushed the qbey/bootstrap-project branch from ba7435a to f049940 Compare March 29, 2025 07:55
@qbey
Copy link
Member Author

qbey commented Mar 29, 2025

Reading the hatch documentation, should we rely on it to run test and managed environments ? See :

* https://hatch.pypa.io/latest/tutorials/environment/basic-usage/

* https://hatch.pypa.io/latest/tutorials/testing/overview/

There is also an existing github action to use hatch. I can do this modification in a new PR once this one merged.

WDYT ?

Sure ! I'm a bit confused between the roles of uv versus hatch to be honest ^^

@qbey qbey merged commit f049940 into main Mar 29, 2025
5 checks passed
@qbey qbey deleted the qbey/bootstrap-project branch March 29, 2025 07:57
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