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

Provide response body upon HTTP fault with publish #2400

Merged

Conversation

sanmai-NL
Copy link
Contributor

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

Debugging the issue described in #2399 was hard, since PDM didn't provide the very helpful response body
{"message":"Validation failed: Description is too long (maximum is 4000 characters)"}. For some reason, capturing the traffic also didn't work out for me. And resorting to that would require much expertise from users.

This enhancement improves things in a straightforward, but simplistic manner. Ideal would be the ability to log all (structured) API endpoint response data to stdout throughout PDM. That would require more investment and architectural redesign.

@sanmai-NL sanmai-NL force-pushed the Provide_debugging_info_for_publish branch from 6e31ada to 52ebaa7 Compare November 13, 2023 16:13
@sanmai-NL
Copy link
Contributor Author

The auto-reformatting by my editor seems legit to me. If not, this code base seems to not configure the appropriate line length then.

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (ec76487) 84.52% compared to head (7171628) 84.50%.
Report is 2 commits behind head on main.

Files Patch % Lines
src/pdm/cli/commands/publish/__init__.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2400      +/-   ##
==========================================
- Coverage   84.52%   84.50%   -0.03%     
==========================================
  Files         102      102              
  Lines       10096    10115      +19     
  Branches     2223     2225       +2     
==========================================
+ Hits         8534     8548      +14     
- Misses       1085     1089       +4     
- Partials      477      478       +1     
Flag Coverage Δ
unittests 84.29% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@pawamoy
Copy link
Contributor

pawamoy commented Nov 13, 2023

@sanmai-NL line length is configured in pyproject.toml, for Ruff, at 120 characters. What tool/config is your editor using to auto-format code?

@frostming
Copy link
Collaborator

The auto-reformatting by my editor seems legit to me. If not, this code base seems to not configure the appropriate line length then.

Maybe you are not using the proper tool for formatting, we are using ruff-fmt now.

@sanmai-NL
Copy link
Contributor Author

Off-topic. But my editor still uses Black. It would be ideal if the repository contained an EditorConfig file that matches the Ruff-specific settings.

root = true

[*]
charset = utf-8
continuation_indent_size = 2
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120
quote_type = single
trim_trailing_whitespace = true
rulers = 100

[*.py]
indent_size = 4
max_line_length = 120
profile = black

Where profile value black would be something like ruff. But I don't know if Ruff supports it yet.

@sanmai-NL
Copy link
Contributor Author

After your review/comment I'll finish the checkbox tasks in the opening post.

src/pdm/cli/commands/publish/__init__.py Outdated Show resolved Hide resolved
src/pdm/cli/commands/publish/__init__.py Outdated Show resolved Hide resolved
src/pdm/cli/commands/publish/__init__.py Outdated Show resolved Hide resolved
src/pdm/cli/commands/publish/__init__.py Outdated Show resolved Hide resolved
@frostming frostming merged commit 1e2f44d into pdm-project:main Nov 16, 2023
21 of 23 checks passed
@sanmai-NL sanmai-NL deleted the Provide_debugging_info_for_publish branch December 20, 2023 11:00
@j178 j178 mentioned this pull request Apr 3, 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.

3 participants