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

Fix test_sdist not finding setup.py or sdist #53

Closed
wants to merge 1 commit into from
Closed

Fix test_sdist not finding setup.py or sdist #53

wants to merge 1 commit into from

Conversation

koobs
Copy link

@koobs koobs commented Jan 24, 2016

Fix test_packaging:test_sdist which was failing with the following errors running py.test from the sdist root:

test/test_packaging.py:40:
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

popenargs = (['/usr/local/bin/python2.7', 'setup.py', 'sdist'],), kwargs = {'cwd': '..'}, process = <subprocess.Popen object at 0x8058db5d0>, output = '', unused_err = None, retcode = 2
cmd = ['/usr/local/bin/python2.7', 'setup.py', 'sdist']
<snip>
------- Captured stderr call ------------
/usr/local/bin/python2.7: can't open file 'setup.py': [Errno 2] No such file or directory

Subsequently, test_sdist failed finding the resulting sdist tarball, with the following error:

E           CalledProcessError: Command '['/usr/local/bin/python2.7', '-m', 'pip', 'install', '--target', '/tmp/tmptcRmwE', '--no-deps', '../dist/txaio-2.2.1.tar.gz']' returned non-zero exit stat
us 2

/usr/local/lib/python2.7/subprocess.py:573: CalledProcessError
----------------------------- Captured stderr call ---------------------------------------------------------------------------------------
Requirement '../dist/txaio-2.2.1.tar.gz' looks like a filename, but the file does not exist

This change fixes those issues accordingly:

  • Fix test_packaging:test_sdist to work from the sdist root, as it cannot
    find setup.py due to cwd=../ being set, assuming the test is being run
    from the test/ directory.
  • Fix validating the resulting sdist (.tar.gz), as the path includes a ../, which
    is incorrect (created in ./dist)

* Fix test_packaging:test_sdist to work from the sdist root, as it cannot
  find setup.py due to cwd=../ being set, assuming the test is being run
  from the test/ directory.
* Fix validating the resulting sdist (.tar.gz), as the path includes a ../, which
  is incorrect (created in ./dist)
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Jan 24, 2016
txaio is a helper library for writing code that runs unmodified
on both Twisted and asyncio / Trollius.

This is like six, but for wrapping over differences between
Twisted and asyncio so one can write code that runs unmodified
on both (aka source code compatibility). In other words: your
users can choose if they want asyncio or Twisted as a dependency.

WWW: https://github.com/crossbario/txaio

[1] crossbario/txaio#53

PR:	206564


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@407115 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Jan 24, 2016
txaio is a helper library for writing code that runs unmodified
on both Twisted and asyncio / Trollius.

This is like six, but for wrapping over differences between
Twisted and asyncio so one can write code that runs unmodified
on both (aka source code compatibility). In other words: your
users can choose if they want asyncio or Twisted as a dependency.

WWW: https://github.com/crossbario/txaio

[1] crossbario/txaio#53

PR:	206564
@oberstet
Copy link
Contributor

Does not work: please see Travis. Note that this works flawlessly on FreeBSD - though not using FBSD packages, but plain vanilla Python built from source.

@koobs
Copy link
Author

koobs commented Jan 24, 2016

@oberstet The errors outlined in #53 (comment) are on a FreeBSD system running py.test or python -m pytest in the root dir

I'm not sure why the tox run fails, nor why the cwd=.. is needed for it.

Edit: It's possible related to the following line in tox.ini:

changedir=test

Which ought not be needed

@oberstet
Copy link
Contributor

I don't know, and as said, I don't use Python system packages on FreeBSD. However, the patch breaks all of our test environments: https://travis-ci.org/crossbario/txaio/builds/104428299

tota pushed a commit to tota/freebsd-ports that referenced this pull request Jan 25, 2016
txaio is a helper library for writing code that runs unmodified
on both Twisted and asyncio / Trollius.

This is like six, but for wrapping over differences between
Twisted and asyncio so one can write code that runs unmodified
on both (aka source code compatibility). In other words: your
users can choose if they want asyncio or Twisted as a dependency.

WWW: https://github.com/crossbario/txaio

[1] crossbario/txaio#53

PR:	206564


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@407115 35697150-7ecd-e111-bb59-0022644237b5
tota pushed a commit to tota/freebsd-ports that referenced this pull request Jan 25, 2016
txaio is a helper library for writing code that runs unmodified
on both Twisted and asyncio / Trollius.

This is like six, but for wrapping over differences between
Twisted and asyncio so one can write code that runs unmodified
on both (aka source code compatibility). In other words: your
users can choose if they want asyncio or Twisted as a dependency.

WWW: https://github.com/crossbario/txaio

[1] crossbario/txaio#53

PR:	206564


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@407115 35697150-7ecd-e111-bb59-0022644237b5
@oberstet oberstet closed this Jan 28, 2016
@meejah
Copy link
Contributor

meejah commented Jan 29, 2016

I can't remember why tox needed it, but all the builders are sad now. Maybe I can setup tox + pytest so that this test only runs on the builders -- and it's not really a great test anyway :/

@meejah
Copy link
Contributor

meejah commented Jan 29, 2016

(I added the test because there was a txaio release that missed something from the manifest)

@koobs
Copy link
Author

koobs commented Jan 30, 2016

@meejah The best-practice method is to:

  1. Have setup.py test hooked up (test_suite) (See pytest: Good integration practices)
  2. Have tests_requires declared (so that they're installed when test is run)
  3. Have tox run the test command

This way the development testing and downstream user/consumer QA testing use-cases are covered.

@meejah
Copy link
Contributor

meejah commented Jan 30, 2016

Thanks for the "setup.py test" hookup link. Your point 3 do you mean, use "python setup.py test" to run the tests (e.g. instead of invoking py.test)?

The real issue with the packaging test is finding the root of the source tree so that python setup.py sdist can be invoked properly (and the resulting tarball found)...but perhaps what you mean is that the test is redundant if the other changes are made?

@koobs
Copy link
Author

koobs commented Jan 30, 2016

@meejah Yep re point (3). one could have tox do its own different invocation (directly execute py.test or something else), but there ought to be no reason not to leverage/use it.

While the test for packaging doesn't appear to be valuable from a testing point of view, since it is release process specific, there is obvious relevance and value from a CI and test producing release artifacts for development purposes point of view.

Having said that, with the changes in this PR, all tests (including the packaging tests) do PASS, since the tests are invoked relative the the sdist root (and not from within test/)

That appears to point to a CI (Tox and/or Travis) environment or configuration issue, not a test issue. Resolving this may just be a matter of the packaging tests being aware of, and not being coupled to which location (cwd) they're being invoked from

@koobs
Copy link
Author

koobs commented Jan 30, 2016

I'll ping you on IRC to discuss further, though it's a little disappointed this PR was closed so quickly

@meejah
Copy link
Contributor

meejah commented Jan 30, 2016

Okay. I basically always run the tests with tox, which does work fine (including the packaging test). The only thing that doesn't work locally for me is doing py.test test/ from the root.

svmhdvn pushed a commit to svmhdvn/freebsd-ports that referenced this pull request Jan 10, 2024
txaio is a helper library for writing code that runs unmodified
on both Twisted and asyncio / Trollius.

This is like six, but for wrapping over differences between
Twisted and asyncio so one can write code that runs unmodified
on both (aka source code compatibility). In other words: your
users can choose if they want asyncio or Twisted as a dependency.

WWW: https://github.com/crossbario/txaio

[1] crossbario/txaio#53

PR:	206564
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

3 participants