Skip to content

Conversation

@p-r-a-v-i-n
Copy link
Member

i think we should move to pyproject.toml bcs maintaining pyproject.toml is easier for long run.
it also add simplicity and remove complexity.

i have shifted all the dependency to single file.
we no longer would need setup.py, requirements , flak8 files anymore.

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from 98d7794 to 6b82c5b Compare December 7, 2025 11:51
@p-r-a-v-i-n p-r-a-v-i-n marked this pull request as draft December 7, 2025 11:52
@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from 6b82c5b to 89379ac Compare December 7, 2025 11:54
@p-r-a-v-i-n p-r-a-v-i-n marked this pull request as ready for review December 7, 2025 11:55
@p-r-a-v-i-n
Copy link
Member Author

I have produce build on master and feature branch and have attached both the build below and screenshot which will show the diff in both the build.

dclick-updated-build.tar.gz
dclick-original-build.tar.gz

Screenshot_2025-12-07_17-32-52

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from 89379ac to 7bd48d8 Compare December 8, 2025 06:36
@p-r-a-v-i-n
Copy link
Member Author

updated build

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from 7bd48d8 to 9f53ea1 Compare December 8, 2025 06:45
@FlipperPA
Copy link
Member

@p-r-a-v-i-n THANK YOU! This is something I've been wanting to dive into for a long while, but have been delayed. I'm not going to get a chance to review this in depth until January (getting married). If anyone else in @django-commons/django-click want to take a look, I wouldn't object!

@FlipperPA
Copy link
Member

FlipperPA commented Dec 8, 2025

I want to ping @ulgens in particular to recognize the great work done lately, and give an opportunity to review.

@ulgens
Copy link
Member

ulgens commented Dec 9, 2025

Thanks @FlipperPA . I added a couple of small notes but other than those, it looks amazing.

Edit: I added couple comments after giving my approval, sorry 😬 I think those comments require only a minimal amount of effort and I can help to handle them if needed.

@ulgens
Copy link
Member

ulgens commented Dec 9, 2025

Both #65 and #64 changes the supported Django versions. If they get merged first, this PR will need a rebase.

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from 9f53ea1 to 7e983c5 Compare December 10, 2025 08:10
pyproject.toml Outdated
Comment on lines 53 to 66
#Automation
"Fabric",
"livereload",

# Packaging
"wheel",
"check-manifest",

# Code linting
"flake8",
"mccabe",
"pep8",
"pep8-naming",
"pyflakes",
Copy link
Member

Choose a reason for hiding this comment

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

Just realized, these are migrated from requirement-dev.txt. Not sure why the new group name is docs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @ulgens ,
what i noticed that we have been using requirement-dev.txt to install the all dependencies including requirement-test.txt. so i broke down this into groups , currently there are 3 groups. all, test, docs.

why group name docs

most of the packages except automation and packaging were related to docs. thats why i choose it.

and thanks that you spotted this . after going through this again i noticed that we don't need wheel and check-manifest now

Comment on lines +2 to +3
requires = ["setuptools>=78.0"]
build-backend = "setuptools.build_meta"
Copy link
Member

@ulgens ulgens Dec 10, 2025

Choose a reason for hiding this comment

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

I'm curious if the setuptools selection over other tools like hatchling was on purpose. Just asking to learn, I'm okay with the selection if it's working fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

nice question. well even i'm also learning and what i have found that setuptools is the most compatible drop-in replacement for migrating from setup.py.

  • currently the setup.py file uses dyanamic python code like Setup.version() , file reading logic this may not be possible in hatchling
  • I have removed the MANIFEST.in currently but there might be chance where we would need to add MANIFEST.in for some reason so hatchling don't support it.
  • setuptools has low risk when migrating from setup.py file.

pyproject.toml Outdated
Comment on lines 43 to 44
{include-group = "test"},
{include-group = "docs"},
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: I'd recommend having alphabetical sorting between groups. Helps to minimize cognitive load and it doesn't seem there is a strong reason to prioritize test group.

Copy link
Member Author

Choose a reason for hiding this comment

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

i will update it.

Copy link
Member

Choose a reason for hiding this comment

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

Let's follow the same ordering here with the groups below.

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from 7e983c5 to 539429e Compare December 10, 2025 09:51
@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from 539429e to 93127a1 Compare December 11, 2025 06:52
ulgens added a commit that referenced this pull request Dec 11, 2025
ulgens added a commit that referenced this pull request Dec 11, 2025
ulgens added a commit that referenced this pull request Dec 11, 2025
@FlipperPA
Copy link
Member

I've merged in the Django upgrades and the redundant packages, so we can rebase now. 👍

@ulgens
Copy link
Member

ulgens commented Dec 11, 2025

@FlipperPA One last PR before the rebase: #65

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from 93127a1 to b695054 Compare December 11, 2025 13:56
@FlipperPA
Copy link
Member

@FlipperPA One last PR before the rebase: #65

Done!

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from b695054 to a553605 Compare December 11, 2025 14:01
@p-r-a-v-i-n p-r-a-v-i-n force-pushed the migrate-to-pyproject-toml branch from a553605 to d7d8d4f Compare December 11, 2025 14:04
@FlipperPA
Copy link
Member

FlipperPA commented Dec 11, 2025

We can leave this for a follow-up action, but after we're done here, we can also migrate the tox.ini configuration into pyproject.toml. I'm not sure it would be cleaner, but it would eliminate a file:

[tool.tox]
legacy_tox_ini = """
[tox]
envlist =
    dj{42,52,60,main}

[gh-actions]
django =
    4.2: dj42
    5.2: dj52
    6.0: dj60
    main: djmain

[testenv]
package = editable
passenv = LC_ALL, LANG, LC_CTYPE
setenv =
    DJANGO_SETTINGS_MODULE=testprj.settings
    PYTHONPATH={toxinidir}/djclick/test/testprj
deps =
    dj42: django>=4.2,<4.3
    dj52: django>=5.2,<5.3
    dj60: django>=6.0,<6.1
    djmain: https://github.com/django/django/archive/main.tar.gz
commands =
    pip install --group test
    pytest -rxs --cov-report= --cov-append --cov djclick {posargs:djclick}
"""

@p-r-a-v-i-n
Copy link
Member Author

I might be completely wrong here but i have feeling that rules set could be improve.
I don't see the linear history.
Screenshot_2025-12-11_19-40-40

Screenshot_2025-12-11_19-44-03

@ulgens
Copy link
Member

ulgens commented Dec 11, 2025

@FlipperPA If that's okay, my vote about tox settings is to keep them separate. I prefer to keep ruff settings in a separate file too. pyproject.toml file can hold settings for lots of tools but it also can get out of control very easily.

@p-r-a-v-i-n That's the result of having merge commits with not-rebased branches. I prefer "rebase merge only" in work projects to keep the history completely linear, or we can enable "require branches to be up to date before merging" - I didn't know that was a general concern.

"pytest-cov",
]
docs = [
# Documentation
Copy link
Member

Choose a reason for hiding this comment

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

The comment is no longer needed.

pyproject.toml Outdated
Comment on lines 43 to 44
{include-group = "test"},
{include-group = "docs"},
Copy link
Member

Choose a reason for hiding this comment

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

Let's follow the same ordering here with the groups below.

@FlipperPA
Copy link
Member

@ulgens I'm all good with keeping tox.ini and ruff settings separate, especially since we have a more-complex-than-most pyproject.toml.

I'm also a fan of rebase merges, but both methods have their shortcomings. If you've ever gotten caught in step-by-step conflict resolution, it isn't fun. :) There's also squash-and-merge, which loses some granularity but keeps commit histories shorter, clean, and linear.

I don't lose sleep over it, so if we want to enforce one way over the other, we can do replays instead of merge or fast-forwards.

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.

3 participants