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

Skipped test in test_coding_standards #2278

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lgolston
Copy link
Contributor

@lgolston lgolston commented Oct 18, 2023

Rationale

The CI server gives a message like: "SKIPPED [1] ../../../../../opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/cartopy/tests/test_coding_standards.py:78: cartopy installation did not look like a git repo: /opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12 is not a git repository." suggesting it cannot find the root directory (locally seems to work fine).

Implications

This PR tries a different approach to finding the git repository location so the test [which checks the license headers] will not be skipped.

Copy link
Contributor

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

Looks like this is being hit in CI now.

REPO_DIR = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'],
stdout=subprocess.PIPE
).communicate()[0].rstrip().decode('utf-8')
REPO_DIR = Path(REPO_DIR)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to keep supporting CARTOPY_GIT_DIR?

Suggested change
REPO_DIR = Path(REPO_DIR)
REPO_DIR = Path(os.getenv("CARTOPY_GIT_DIR", REPO_DIR))

@QuLogic
Copy link
Member

QuLogic commented Dec 7, 2023

This might be problematic for downstream packagers if they put their stuff in git and Cartopy is unpacked in that directory. But downstream packagers probably don't want to check stylistic things like this, so tests like this should probably get a pytest marker so they can be skipped.

@rcomer
Copy link
Member

rcomer commented Feb 25, 2024

Over at SciTools/cf-units#364 (comment), @pelson suggested these checks would be better via pre-commit hooks. I found this insert-license is a supported hook.

Edit: I opened SciTools/.github#22 to see if Iris wants to do something like that. If they do, we could just follow.

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.

None yet

4 participants