Skip to content

Replace __file__ with pkgutil.get_data #30

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

Merged
merged 5 commits into from
Mar 10, 2020
Merged

Conversation

jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Dec 22, 2019

Closes #25

These packages are not needed to run tests,
and they polute the testbed.
`__file__` is an optional attribute which isnt available in zipapps
and PyOxidizer.  Use pkgutil.get_data instead.

Closes pypi#25
@@ -10,15 +10,11 @@ python:
- 3.7
- 3.8

before_install:
- pip install -r requirements-dev.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

We need this for other stuff that will be added later. Can you revert this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Umm, iirc if they are installed the list at https://github.com/jackmaney/python-stdlib-list/pull/30/files#diff-9e9ddedef65dec3da86063a067839e65R36 becomes quite large.

I suggest when they are needed on Travis, they are installed inside a tox testenv. I didnt delete the file - it is still available to be used for other Travis jobs, e.g. a docs or publish job, and can be used by devs locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense. Let's keep them away for now and I'll send another PR later for this.

Let's keep this in! Thanks for the tests and improvements. I'll see if I can get a new release out after this.

install:
- python setup.py sdist && version=$(python setup.py --version) && pushd dist && pip install stdlib-list-${version}.tar.gz && popd

script:
# FIXME: add some real test.
- python -c "import stdlib_list; print(stdlib_list.stdlib_list('$TRAVIS_PYTHON_VERSION'))"
- python -m tests
Copy link
Contributor

Choose a reason for hiding this comment

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

\o/

@ocefpaf ocefpaf merged commit 9ed04d0 into pypi:master Mar 10, 2020
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.

Avoid failing if __file__ doesnt exist / PyOxidizer support
2 participants