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

fix: Remove os-dependent pieces of schema validation #2357

Merged
merged 6 commits into from
Oct 24, 2023

Conversation

kratsg
Copy link
Contributor

@kratsg kratsg commented Oct 24, 2023

Pull Request Description

Resolves #2353. To allow pyhf to work a little bit better, at least on schemas on Windows, need to rely either on pathlib more fully or os.sep in order to build the paths correctly.

  • fix schema loading by making it strictly os-independent
  • add an additional example that is os-independent

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Use pathlib to build the stem for the schema to use (version + type of schema).
   - c.f. https://github.com/python/cpython/issues/65238

@kratsg kratsg added bug Something isn't working schema and spec JSON schema fix A bug fix labels Oct 24, 2023
@kratsg kratsg self-assigned this Oct 24, 2023
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5093668) 98.28% compared to head (05335e2) 98.28%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2357   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files          69       69           
  Lines        4538     4539    +1     
  Branches      803      803           
=======================================
+ Hits         4460     4461    +1     
  Misses         45       45           
  Partials       33       33           
Flag Coverage Δ
contrib 97.86% <100.00%> (+<0.01%) ⬆️
doctest 60.71% <100.00%> (+<0.01%) ⬆️
unittests-3.10 96.29% <100.00%> (+<0.01%) ⬆️
unittests-3.11 96.29% <100.00%> (+<0.01%) ⬆️
unittests-3.8 96.32% <100.00%> (+<0.01%) ⬆️
unittests-3.9 96.34% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
src/pyhf/schema/validator.py 100.00% <100.00%> (ø)

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

Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

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

Thanks @kratsg. I just did some typo fixes and also linked to python/cpython#65238.

@matthewfeickert matthewfeickert added docs Documentation related need-to-backport tmp label until can be backported to patch release branch labels Oct 24, 2023
@kratsg kratsg changed the title fix: Remove os-dependent pieces of schema validation Draft: fix: Remove os-dependent pieces of schema validation Oct 24, 2023
@matthewfeickert matthewfeickert marked this pull request as draft October 24, 2023 22:02
@matthewfeickert matthewfeickert changed the title Draft: fix: Remove os-dependent pieces of schema validation fix: Remove os-dependent pieces of schema validation Oct 24, 2023
@matthewfeickert
Copy link
Member

@kratsg I see that you want to keep this in draft mode for the time being. I am okay to merge this whenever you're ready assuming no additional large changes.

@kratsg kratsg marked this pull request as ready for review October 24, 2023 22:07
@matthewfeickert matthewfeickert removed the docs Documentation related label Oct 24, 2023
Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

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

Thanks for checking this against both Windows 10 and Windows 11, @kratsg. 👍

@matthewfeickert matthewfeickert merged commit 6203a8f into main Oct 24, 2023
21 checks passed
@matthewfeickert matthewfeickert deleted the fix/windowsSchemaPaths branch October 24, 2023 22:35
@matthewfeickert matthewfeickert removed bug Something isn't working need-to-backport tmp label until can be backported to patch release branch labels Oct 25, 2023
matthewfeickert added a commit that referenced this pull request Oct 25, 2023
* Backport PR #2357
* Use pathlib to build the stem for the schema to use (version + type of schema).
   - c.f. python/cpython#65238

Co-authored-by: Giordon Stark <[email protected]>
@matthewfeickert matthewfeickert added the Windows Issue related to Microsoft Windows label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A bug fix schema and spec JSON schema Windows Issue related to Microsoft Windows
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

jsonschema cannot find path specified \\1.0.0\\def.json
2 participants