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

PINT does not run on Windows. #1791

Open
matteobachetti opened this issue Jun 21, 2024 · 3 comments
Open

PINT does not run on Windows. #1791

matteobachetti opened this issue Jun 21, 2024 · 3 comments

Comments

@matteobachetti
Copy link
Contributor

matteobachetti commented Jun 21, 2024

I’m having a problem running CI tests on a Windows architecture in a code that uses PINT under the hood, because:

  1. PINT uses getpass.getuser()
  2. getpass requires the pwd module, which does not exist on Windows.

But it would seem that this getuser operation could be easily made optional (or hardcoded differently in Windows), or maybe you know some tricks to make this work.

It would be good to have at least some basic functionality work on Windows.

@dlakaplan
Copy link
Contributor

Hi, @matteobachetti . We have done very little testing with windows, and I don't know if there are other things that will fail.

The use of getpass.getuser is pretty minimal. It's just used to produce an informative string to include in par/tim files. You can turn just that off when writing files (e.g., write_TOA_file(..., include_info=False), m.as_parfile(..., include_info=False)). That might be enough to get you past this.

We can easily code in a skip of this entirely, but I'm not sure where the failures are. Are there with import getpass? Later on? There are alternatives one can try for windows but I don't know who can really test things. If this is something you need, could you try some of them (maybe from https://stackoverflow.com/questions/13654122/how-to-make-python-get-the-username-in-windows-and-then-implement-it-in-a-script or similar) and see what you suggest?

@matteobachetti
Copy link
Contributor Author

Thanks @dlakaplan! I used include_info=False as a workaround of this specific issue.
I have students of a Time Series course that are using Windows and might stumble on issues like this though, probably worth taking a look. Thanks also for the additional resources, I'll try to look for a solution at PINT level!

@dlakaplan
Copy link
Contributor

OK, let us know if windows seems workable. We don't have any CI testing on windows and I don't know what other issues might come up. Questions with how windows handles extended precision have come up before (e.g., #1389) but I don't really know all of the implications.

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

No branches or pull requests

2 participants