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

Fixes to get chandra_models and paths working on Windows #34

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Jun 2, 2023

Description

With these changes the package is passing unit tests on Windows, assuming that the chandra_models repo that it sees is not "dirty". That currently happens if the repo is cross mounted in Parallels from a Mac. For my testing I defined the CHANDRA_MODELS_REPO_DIR environment to point to a clean version of the repo. This in turn led to another fix in the tests.

Interface impacts

Testing

Unit tests

  • Mac : TODO
  • Linux : TODO
  • Windows

Independent check of unit tests by Javier

  • Mac
  • Linux
  • Windows

Functional tests

No functional testing.

@taldcroft taldcroft changed the title WIP: Fixes to get chandra_models and paths working on Windows Fixes to get chandra_models and paths working on Windows Jun 2, 2023
Copy link
Collaborator

@javierggt javierggt left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me, and the test pass in my windows VM, so I'm ok.

I only had one trivial question which might just be answered here on github.

@@ -193,7 +215,8 @@ def get_data(
data, repo_file_path = read_func(repo_file_path, **read_func_kwargs)

# Compute the MD5 sum of repo_file_path.
md5 = hashlib.md5(repo_file_path.read_bytes()).hexdigest()
file_bytes = repo_file_path.read_bytes().replace(b"\r", b"")
Copy link
Collaborator

Choose a reason for hiding this comment

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

why .replace(b"\r", b"")?

Copy link
Member Author

Choose a reason for hiding this comment

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

The file in the windows repo has been "fixed" by git to have windows line endings, so the MD5 sum doesn't match Linux.

@javierggt
Copy link
Collaborator

Note: I also ran the tests on Linux and OSX

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