Skip to content

Refactor: Use static version parsing in setup.py#737

Open
RinZ27 wants to merge 2 commits into
iMerica:masterfrom
RinZ27:refactor/static-version-parsing
Open

Refactor: Use static version parsing in setup.py#737
RinZ27 wants to merge 2 commits into
iMerica:masterfrom
RinZ27:refactor/static-version-parsing

Conversation

@RinZ27

@RinZ27 RinZ27 commented Mar 19, 2026

Copy link
Copy Markdown

Parsing the version string using exec() during package setup introduces unnecessary runtime dependencies and potential side effects. While functional, a more resilient and idiomatic approach involves static extraction of the version attribute from dj_rest_auth/__version__.py without code execution.

Implementing a regex-based search for the __version__ variable ensures the setup process remains focused and secure across different environments. This refactoring aligns with modern Python packaging standards and eliminates the risk associated with dynamic evaluation of external files during installation.

@iMerica

iMerica commented Mar 22, 2026

Copy link
Copy Markdown
Owner

This changes many things which are outside the scope of the intent defined in the PR title/summary.

@RinZ27

RinZ27 commented Mar 22, 2026

Copy link
Copy Markdown
Author

@iMerica My apologies for the noise in the initial commit. I've just reverted the unrelated changes to setup.py (dependency versions, classifiers, etc.) and kept only the static version parsing via regex as originally intended. Also verified that the install_requires and other metadata now match the master branch exactly. Thanks for catching that.

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