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

always generate posix paths in manifests #913

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

glguy
Copy link
Contributor

@glguy glguy commented Feb 16, 2023

I've adapted the manifest builder to always build paths with forward slash. My reading of the documentation is that Python on Windows will translate these automatically.

@kityansiu does this fix generating the turnstile example for you?

@glguy glguy requested a review from kityansiu February 16, 2023 22:49
@weisenje
Copy link
Contributor

@glguy I get this error (running on Windows) - let me know if I'm doing something wrong.
@kityansiu

$ rack manifest build manifest.yaml turnstile
Traceback (most recent call last):
  File "C:\Users\200005868\projects\rack\RACK\cli\venv2\Scripts\rack", line 69, in <module>
    func(args)
  File "C:\Users\200005868\projects\rack\RACK\cli\venv2\lib\site-packages\rack\__init__.py", line 877, in dispatch_manifest_build
    build_manifest_driver(Path(args.config), Path(args.zipfile))
  File "C:\Users\200005868\projects\rack\RACK\cli\venv2\lib\site-packages\rack\__init__.py", line 506, in build_manifest_driver
    builder.manifest(manifest_path, Path(outdir).joinpath(f'manifest.yaml'))
  File "C:\Users\200005868\projects\rack\RACK\cli\venv2\lib\site-packages\rack\__init__.py", line 470, in manifest
    self.manifest(base_path.joinpath(path), topath)
  File "C:\Users\200005868\projects\rack\RACK\cli\venv2\lib\site-packages\rack\__init__.py", line 470, in manifest
    self.manifest(base_path.joinpath(path), topath)
  File "C:\Users\200005868\projects\rack\RACK\cli\venv2\lib\site-packages\rack\__init__.py", line 479, in manifest
    step['model'] = str(PosixPath(dirname).joinpath(PosixPath(path).name))
  File "C:\Users\200005868\Miniconda3\lib\pathlib.py", line 1074, in __new__
    raise NotImplementedError("cannot instantiate %r on your system"
NotImplementedError: cannot instantiate 'PosixPath' on your system

@glguy
Copy link
Contributor Author

glguy commented Feb 17, 2023

Well shoot. I was hoping that by using the posix-specific path class it wouldn't auto detect and use windows path separators. Back to the drawing board <_<

@glguy
Copy link
Contributor Author

glguy commented Feb 17, 2023

@weisenje after reading more documentation (and testing on a spare laptop) I think this commit is the fix

@glguy glguy merged commit 9af8e15 into master Feb 21, 2023
@glguy glguy deleted the manifest-build-force-posix-paths branch February 21, 2023 00:24
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

2 participants