Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rationalize python configuration on pyproject.toml and update build system to hatch #1720

Open
butler54 opened this issue Oct 11, 2024 · 3 comments
Assignees
Labels
Backlog enhancement New feature or request

Comments

@butler54
Copy link
Collaborator

Issue description / feature objectives

The recommended method fro managing python packages now is using pyproject.toml which we already have (based on this: https://packaging.python.org/en/latest/).

setup.py is no longer a pseudo-requirement as you can put in different build systems. There are a large number of options fro build tools: https://packaging.python.org/en/latest/key_projects/. The python packing authority is supporting a number of them. hatch and hatchling is the most popular to the modernized tools.

Caveats / Assumptions

  • The default new hatch project setup has a src directory. This will not be used.

Completion Criteria

  • Build system is replaced with hatch
  • As many as possible of the configuration files are converged on pyproject.toml
@butler54 butler54 self-assigned this Oct 11, 2024
@jpower432 jpower432 added the enhancement New feature or request label Oct 14, 2024
@jpower432 jpower432 moved this from New to Ready in Trestle Roadmap Oct 14, 2024
@butler54
Copy link
Collaborator Author

I've done a little baseline work on this already. One interesting side-complication that has come up is we get the greatest benefit (in terms of stack and number of dependencies) when we converge on ruff for linting and formatting which is the default.

Ruff, by default is pedantic, even when excluding the quote style (it defaults to double quotes). Most of the differences are related to two topics:

  1. Changes that relate to how to do type annotations with python 3.9 and above (which was not the default when trestle was first created)

  2. String formatting as it applies to logs (moving to lazy evaluation where possible for logs).

We'll need to discuss this before moving forward.

1121 UP006
 445 G004
 375 TRY003
 341 SLF001
 289 FA100
 276 EM102
 255 FBT001
 222 UP035
 206 UP009
 148 ARG001
 130 RUF100
 123 FBT002
 122 BLE001
 116 PLR0402
 115 EM101
 114 W605
 114 UP007
  99 I001
  93 RET504
  91 SIM118
  81 B904
  80 G003
  48 PERF401
  43 UP039
  35 TRY301
  32 PT006
  31 RET505
  30 PLR2004
  29 SIM300
  29 PLW2901
  24 SIM108
  23 UP015
  23 RUF012
  23 ISC003
  21 PT003
  20 SIM102
  19 TRY300
  18 TD004
  18 SIM115
  17 TRY400
  17 TRY002
  17 RUF013
  17 RUF010
  15 TCH001
  15 PT012
  15 E721
  14 PLR5501
  13 ARG002
  12 PT007
  11 SIM201
   9 RUF005
   9 PIE794
   9 DTZ011
   8 RUF015
   8 PIE804
   7 PERF102
   6 UP028
   6 RUF003
   6 RET507
   6 PT011
   6 PLR1722
   6 PLR1714
   6 PERF402
   6 DTZ005
   6 B017
   5 UP008
   5 TRY201
   5 SIM105
   5 PT018
   4 TID252
   4 S101
   4 RET503
   4 PIE790
   4 N806
   4 ARG004
   3 UP018
   3 TCH003
   3 SIM910
   3 SIM210
   3 SIM114
   3 SIM113
   3 SIM110
   3 S314
   3 PT017
   3 FLY002
   2 W292
   2 UP024
   2 SIM212
   2 SIM211
   2 SIM101
   2 S105
   2 RET508
   2 RET506
   2 PLR1701
   2 PIE810
   2 PIE808
   2 N803
   2 INP001
   1 UP037
   1 UP003
   1 TRY302
   1 TRY004
   1 SIM117
   1 SIM103
   1 S605
   1 S602
   1 RSE102
   1 PT014
   1 PLW0129
   1 PLR0133
   1 PLE1205
   1 N817
   1 N804
   1 E999
   1 E713
   1 DTZ006
   1 DTZ002
   1 B018
   1 B016

@degenaro
Copy link
Collaborator

degenaro commented Nov 8, 2024

Visiting PyPi, we see there are some Unverified Details. These include:

Author: IBM
Provides-Extra: dev

According to PyPi here https://pypi.org/manage/project/compliance-trestle/settings/:

To set the 'compliance-trestle' description, author, links, classifiers, and other details for your next release, use the project metadata fields in your pyproject.toml file. Updating these fields will not change the metadata for past releases. Additionally, you must use Twine to upload your files in order to get full support for these fields. See the Python Packaging User Guide for more help.

Either as a part of this issue, or we can open a new issue, the Author: should be changed to The OSCAL Compass Authors and the email should be changed to (mailto:[email protected]) and chat should be added Slack: #oscal-compliance-trestle-agileauthoring-c2p

@butler54
Copy link
Collaborator Author

butler54 commented Dec 5, 2024

Just discussing on community call

Make this step 1: Cut across from setup.py -> pyproject.toml
Step 2: start at ruff
Step 3: cut across linters including pre-commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog enhancement New feature or request
Projects
Status: Ready
Development

No branches or pull requests

3 participants