Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move Python files that are *scripts* into /scripts/ and adjust.#4819

Merged
pascalfleury merged 1 commit into
schemaorg:mainfrom
pascalfleury:move-scripts
May 21, 2026
Merged

Move Python files that are *scripts* into /scripts/ and adjust.#4819
pascalfleury merged 1 commit into
schemaorg:mainfrom
pascalfleury:move-scripts

Conversation

@pascalfleury
Copy link
Copy Markdown
Contributor

Scripts (Python files expected to be called on the command line) are moved into the script dir.

  • we also adjust all other Python files, documentation;
  • we remove all the import path handling from non-script files;
  • we further assume the directory from which these are run is the root of the project (i.e. schemaorg) and therefore loading other Python files can be greatly simplified;
  • we moved any import that is not at the top of the file to ... the top of the file;
  • the example-code is also adjusted so it works like described in the documentation.

@pascalfleury pascalfleury requested a review from jlndr May 19, 2026 08:55
@pascalfleury pascalfleury force-pushed the move-scripts branch 3 times, most recently from 8e27485 to 20194bd Compare May 19, 2026 11:45
}

TYPES: #eg-314 DefinedTerm, DefinedTermSet, inDefinedTermSet
TYPES: #eg-0315 DefinedTerm, DefinedTermSet, inDefinedTermSet
Copy link
Copy Markdown
Contributor

@jlndr jlndr May 20, 2026

Choose a reason for hiding this comment

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

the 0 padding I wouldn't be so surprised by - do we know where the +1 increment is coming fro?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it does count from a number, based on the number of valid types we have. As I let Gemini verify the examples it could be that these were outdated anyway. and there is no test to assert that the examples a) result in this, and b) actually work.

<div>
<div itemscope itemtype="https://schema.org/DefinedTermSet">
<meta itemprop="additionalType" content="https://schema.org/Book">
<link itemprop="additionalType" href="https://schema.org/Book">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does the change which cause this diff impact the site generation also?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the same reason, the examples code has been verified.


# Setup testharness state BEFORE importing sdo libraries
setInTestHarness(True)
# Ensure that the google.appengine.* packages are available
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is a test? can this be in main?

Comment thread software/scripts/compareterms.py Outdated
from testharness import *

# Setup testharness state BEFORE importing sdo libraries
setInTestHarness(True)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here, can this be in main?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Scripts (Python files expected to be called on the command line) are
moved into the script dir.
We also adjust all other Python files, documentation, and remove all the
import path handling from non-script files.
We further assume the directory from which these are run is the root of
the project (i.e. `schemaorg`) and therefore loading other Python files can
be greatly simplified.
@pascalfleury pascalfleury merged commit 8509c8f into schemaorg:main May 21, 2026
1 check passed
@pascalfleury pascalfleury deleted the move-scripts branch May 21, 2026 09:04
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