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

Two Assertion failures on Windows tests (script_header) #37

Closed
ghost opened this issue Jul 13, 2013 · 3 comments
Closed

Two Assertion failures on Windows tests (script_header) #37

ghost opened this issue Jul 13, 2013 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 13, 2013

Originally reported by: jaraco (Bitbucket: jaraco, GitHub: jaraco)


I do regularly run the tests on Windows. Back around 0.6.21 or so, the tests were passing on Windows in totality. When I run the tests now, I get two failures in tests due to shebang lines in scripts (complete transcript):

======================================================================
FAIL: test_get_script_args (setuptools.tests.test_easy_install.TestEasyInstallTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\jaraco\projects\setuptools\setuptools\tests\test_easy_install.py", line 86, in test_get_script_args
    self.assertEqual(script, WANTED)
AssertionError: '#!"C:\\Program Files\\Python33\\python.exe"\n# EASY-INSTALL-ENTRY-SCRIPT: \'spe [truncated]... != "#!C:\\Program Files\\Python33\\python.exe\n# EASY-INSTALL-ENTRY-SCRIPT: 'spec', [truncated]...
- #!"C:\Program Files\Python33\python.exe"
?   -                                    -
+ #!C:\Program Files\Python33\python.exe
  # EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name'
  __requires__ = 'spec'
  import sys
  from pkg_resources import load_entry_point

  if __name__ == '__main__':
      sys.exit(
          load_entry_point('spec', 'console_scripts', 'name')()
      )


======================================================================
FAIL: test_get_script_header (setuptools.tests.test_resources.ScriptHeaderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\jaraco\projects\setuptools\setuptools\tests\test_resources.py", line 508, in test_get_script_header
    '#!%s\n' % os.path.normpath(sys.executable))
AssertionError: '#!"C:\\Program Files\\Python33\\python.exe"\n' != '#!C:\\Program Files\\Python33\\python.exe\n'
- #!"C:\Program Files\Python33\python.exe"
?   -                                    -
+ #!C:\Program Files\Python33\python.exe


----------------------------------------------------------------------

I've been ignoring these test failures because I believe it is the tests that are broken and not the implementation. I suspect these tests will not fail when there is not a space in the path to python.exe.


@ghost
Copy link
Author

ghost commented Jul 13, 2013

Original comment by arfrever (Bitbucket: arfrever, GitHub: arfrever):


Shebangs do not work at all on Windows, so these tests could be skipped on Windows.

Quotes in shebang are interpreted as integral part of path (at least on Linux):

$ cat test1.sh
#!/bin/bash
$ cat test2.sh
#!"/bin/bash"
$ ./test1.sh
$ ./test2.sh
bash: ./test2.sh: "/bin/bash": bad interpreter: No such file or directory
$

Such quotes should not be added around a path with spaces. Probably tests should be skipped in such situation.

@ghost
Copy link
Author

ghost commented Jul 13, 2013

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


I believe that both setuptools and the Windows py launcher both honor the shebang in Python scripts and more importantly do a better job of it than Unix does, supporting valid filenames with spaces in them. Furthermore, I'd like to get these tests passing as they're not only testing the headers.

@ghost
Copy link
Author

ghost commented Aug 10, 2013

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Fixed script header generation in easy_install tests. Fixes #37.

@ghost ghost added minor bug labels Mar 29, 2016
@ghost ghost closed this as completed Mar 29, 2016
jaraco added a commit that referenced this issue Jan 16, 2021
* Replace pep517.build with build

Resolves #30

* Prefer simple usage

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
jaraco added a commit that referenced this issue Jan 16, 2021
* Use `extend-ignore` in flake8 config

This option allows to add extra ignored rules to the default list
instead of replacing it.

The default exclusions are: E121, E123, E126, E226, E24, E704,
W503 and W504.

Fixes #28.

Refs:
* https://github.com/pypa/setuptools/pull/2486/files#r541943356
* https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-extend-ignore
*
https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-ignore

* Enable complexity limit. Fixes jaraco/skeleton#34.

* Replace pep517.build with build (#37)

* Replace pep517.build with build

Resolves #30

* Prefer simple usage

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Use license_files instead of license_file in meta (#35)

Singular `license_file` is deprecated since wheel v0.32.0.

Refs:
* https://wheel.readthedocs.io/en/stable/news.html
* https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
jaraco added a commit that referenced this issue Jul 4, 2021
distutils: pass -rpath on macOS when requested
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants