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

Python 3 only -- fixes deprecation warnings #63

Merged
merged 11 commits into from Nov 5, 2019
Merged

Conversation

digitalresistor
Copy link
Member

@digitalresistor digitalresistor commented Nov 4, 2019

This updates the project in a couple of ways:

  • We now use a src folder structure
  • Tests are now in their own top-level folder, so we don't ship them anymore
  • use setup.cfg instead of setup.py and add pyproject.toml
  • move to updated tox.ini stolen from various projects
  • Update source code to no longer have compat.py
  • Update travis to use newer versions of Python (I may move this to Github actions in the future)
  • Remove the imp import and fix the code
  • Added MANIFEST.in

This replaces #62 by just removing those code paths that depended on the constants. In the Python 3 world due to the use of __pycache__ we no longer need to protect against importing "orphaned" files. This is because it is perfectly valid to "ship" .pyc files and we do actually want to import them directly.

There may be some more iterations that need to be done, to clean up the logic just a little bit, especially since I had to add some # pragma: nocover on certain branches that are not being hit on any of the interpreters I am testing on (py 3.5 -> py 3.8 and pypy3).

Closes #57
Closes #62

if module is not None:
for name, ob in getmembers(module, None):
invoke(modname, name, ob)
get_filename = getattr(loader, 'get_filename', None)
Copy link
Member Author

Choose a reason for hiding this comment

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

Meat of the change here...

@digitalresistor digitalresistor merged commit 24f782d into master Nov 5, 2019
@digitalresistor digitalresistor deleted the py3-only branch November 5, 2019 01:43
@fschulze
Copy link
Contributor

fschulze commented Nov 5, 2019

There is some weirdness going on with the venusian 2.0.0 release.

This PR adds python_requires, but https://pypi.org/simple/venusian/ doesn't have it. I just tested running devpi-server tests with the py27 tox environment and it actually did install venusian 2.0.0, but it worked just fine. Is it possible the code path isn't relevant for clean tox runs?

@digitalresistor
Copy link
Member Author

@fschulze you are correct. I apologise for this. I'm working on fixing it.

@digitalresistor
Copy link
Member Author

@fschulze I don't know if the code path isn't relevant for tox runs, but it certainly will not work on Python 2 correctly. You'll only see the issues likely if your tests make sure to run venusian's scan() at some point... if you don't in your tests, your tests won't catch this.

@digitalresistor
Copy link
Member Author

@fschulze I've re-released 1.2.0 as 2.1.0, which is the last version that supported both versions. I've re-released 2.0.0 as 3.0.0 and this time it correctly is marked as Python 3 only (and the Requires-Python metadata is correctly set)

@fschulze
Copy link
Contributor

fschulze commented Nov 6, 2019

Thanks! Indeed the tests don't trigger scan.

BTW, devpi-server is great for checking things like this before uploading to PyPI 😉

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Jun 17, 2023
3.0.0 (2019-10-04)
------------------

- This release matches 2.0.0 other than in the version number. This fixes an
  issue with Requires-Python metadata not being uploaded correctly to PyPi.

  This version is only compatible with Python 3.5+

2.0.0 (2019-10-04)
------------------

- Drop support for Python 2.7, 3.3, and 3.4

- Removed the usage of the ``imp`` module to squelch the warnings regarding a
  deprecated modules. See Pylons/venusian#63 and
  Pylons/venusian#57

1.2.0 (2019-01-08)
------------------

- Add support for Python 3.7.

- Drop support for Python 3.3.

1.1.0 (2017-04-24)
------------------

- Updated to using py.test instead of nosetest, and added support for Python
  3.4 -> 3.6

- Make scanning more resilient of metaclasses that return proxies for any
  attribute access.

- Fix bug where using the same venusian decorator on both a class and its
  methods would cause the method decorations to be ignored. See
  Pylons/venusian#40

- Drop support for Python 2.6.

- Drop support for Python 3.2:  it is no longer supported by current
  packaging / CI tools.

- Support loaders that require the module name as argument to their
  ``get_filename()`` method. This fixes problems with zipped packages
  on Python 3.

- Micro-optimization when ignores are used (see
  Pylons/venusian#20).

- A tox run now combines coverage between Py2 and Py3.
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.

The imp module is deprecated in Python 3.6
3 participants