
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
PytestAssertRewriteWarning when installing a plugin in editable mode Β· Issue #10230 Β· pytest-dev/pytest
Description:
Create an empty plugin (pytest-plugin) as follows: pyproject.toml [build-system] requires = ['setuptools'] build-backend = 'setuptools.build_meta' [project] name = 'pytest-plugi...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Mobile Technology & AI
- Social Networks
- Technology & Computing
Content Management System {π}
What CMS is github.com built with?
Github.com is built with WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,653,586 visitors per month in the current month.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 5,316,011 paying customers.
The estimated monthly recurring revenue (MRR) is $22,327,244.
The estimated annual recurring revenues (ARR) are $267,926,929.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
editable, pytest, plugin, issue, pip, pytestplugin, sign, pytestassertrewritewarning, collection, projects, mode, installation, modules, mentioned, added, navigation, pull, requests, actions, security, installing, closed, description, gergelykalmar, empty, setuptools, project, version, install, linux, pluggy, pytestpluginlibpythonsitepackagespytestconfiginitpy, module, docs, warning, mechanism, update, list, ignore, topic, related, phase, nicoddemus, commit, references, github, type, milestone, footer, skip,
Topics {βοΈ}
/pytest-dev/pytest/blob/main/src/_pytest/config/__init__ 8/site-packages/_pytest/config/__init__ toml-based editable builds /pytest-plugin/lib/python3 assigned labels topic org/en/stable/ activity gergelykalmar mentioned site-packages/__editable___pytest_plugin_0_0_1_finder personal information pytestassertrewritewarning 5c5ca77 lewisgaul mentioned update dependency pytest comment metadata assignees /pytest-plugin plugins collection phase type editable mode type projects pip list projects milestone linux flux 5 detailed description pytest-plugin 2 pytest-plugin 0 run pytest build_meta' [project] /capture-warnings collection related txt pip==22 issue pytestassertrewritewarning empty plugin entry-points docs //docs virtual environment warning due milestone relationships update https 2 pytest==7 pytest-7 pytest 1' [project py files mechanism //github github pip //pip plugin plugin-0 __editable___pytest_plugin_0_0_1_finder
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:PytestAssertRewriteWarning when installing a plugin in editable mode
articleBody:Create an empty plugin (`pytest-plugin`) as follows:
`pyproject.toml`
```
[build-system]
requires = ['setuptools']
build-backend = 'setuptools.build_meta'
[project]
name = 'pytest-plugin'
version = '0.0.1'
[project.entry-points.pytest11]
plugin = 'pytest_plugin.main'
```
`requirements.txt`
```
pip==22.2.2
pytest==7.1.2
```
`pytest_plugin/main.py`
```
"""
An empty plugin.
"""
```
Install the plugin in editable mode:
```
> pip install -e .
```
Run pytest:
```
> pytest
=== test session starts ===
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: .../pytest-plugin
plugins: plugin-0.0.1
collected 0 items
=== warnings summary ===
.../pytest-plugin/lib/python3.8/site-packages/_pytest/config/__init__.py:1129
.../pytest-plugin/lib/python3.8/site-packages/_pytest/config/__init__.py:1129: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: __editable___pytest_plugin_0_0_1_finder
self._mark_plugins_for_rewrite(hook)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=== 1 warning in 0.02s ===
```
The issue seems to be that pytest tries re-writing the module under `site-packages/__editable___pytest_plugin_0_0_1_finder.py` which I think is created by pip. Note that a new mechanism for `pyproject.toml`-based editable builds was introduced in https://pip.pypa.io/en/stable/news/#v21-3, which I believe doesn't use the egg-based editable mechanism anymore.
It might be that it would be enough to update https://github.com/pytest-dev/pytest/blob/main/src/_pytest/config/__init__.py#L799 to exclude the editable installation finder modules (similar to how `setup.py` files are excluded).
```
> pip list
Package Version Editable project location
------------- ------- --------------------------------------------
attrs 22.1.0
iniconfig 1.1.1
packaging 21.3
pip 22.2.2
pkg_resources 0.0.0
pluggy 1.0.0
py 1.11.0
pyparsing 3.0.9
pytest 7.1.2
pytest-plugin 0.0.1 .../pytest-plugin
setuptools 44.0.0
tomli 2.0.1
> uname -a
Linux flux 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
```
- [x] a detailed description of the bug or problem you are having
- [x] output of `pip list` from the virtual environment you are using
- [x] pytest and operating system versions
- [x] minimal example if possible
author:
url:https://github.com/GergelyKalmar
type:Person
name:GergelyKalmar
datePublished:2022-08-20T11:06:52.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:0
url:https://github.com/10230/pytest/issues/10230
context:https://schema.org
headline:PytestAssertRewriteWarning when installing a plugin in editable mode
articleBody:Create an empty plugin (`pytest-plugin`) as follows:
`pyproject.toml`
```
[build-system]
requires = ['setuptools']
build-backend = 'setuptools.build_meta'
[project]
name = 'pytest-plugin'
version = '0.0.1'
[project.entry-points.pytest11]
plugin = 'pytest_plugin.main'
```
`requirements.txt`
```
pip==22.2.2
pytest==7.1.2
```
`pytest_plugin/main.py`
```
"""
An empty plugin.
"""
```
Install the plugin in editable mode:
```
> pip install -e .
```
Run pytest:
```
> pytest
=== test session starts ===
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: .../pytest-plugin
plugins: plugin-0.0.1
collected 0 items
=== warnings summary ===
.../pytest-plugin/lib/python3.8/site-packages/_pytest/config/__init__.py:1129
.../pytest-plugin/lib/python3.8/site-packages/_pytest/config/__init__.py:1129: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: __editable___pytest_plugin_0_0_1_finder
self._mark_plugins_for_rewrite(hook)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=== 1 warning in 0.02s ===
```
The issue seems to be that pytest tries re-writing the module under `site-packages/__editable___pytest_plugin_0_0_1_finder.py` which I think is created by pip. Note that a new mechanism for `pyproject.toml`-based editable builds was introduced in https://pip.pypa.io/en/stable/news/#v21-3, which I believe doesn't use the egg-based editable mechanism anymore.
It might be that it would be enough to update https://github.com/pytest-dev/pytest/blob/main/src/_pytest/config/__init__.py#L799 to exclude the editable installation finder modules (similar to how `setup.py` files are excluded).
```
> pip list
Package Version Editable project location
------------- ------- --------------------------------------------
attrs 22.1.0
iniconfig 1.1.1
packaging 21.3
pip 22.2.2
pkg_resources 0.0.0
pluggy 1.0.0
py 1.11.0
pyparsing 3.0.9
pytest 7.1.2
pytest-plugin 0.0.1 .../pytest-plugin
setuptools 44.0.0
tomli 2.0.1
> uname -a
Linux flux 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
```
- [x] a detailed description of the bug or problem you are having
- [x] output of `pip list` from the virtual environment you are using
- [x] pytest and operating system versions
- [x] minimal example if possible
author:
url:https://github.com/GergelyKalmar
type:Person
name:GergelyKalmar
datePublished:2022-08-20T11:06:52.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:0
url:https://github.com/10230/pytest/issues/10230
Person:
url:https://github.com/GergelyKalmar
name:GergelyKalmar
url:https://github.com/GergelyKalmar
name:GergelyKalmar
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:0
interactionType:https://schema.org/CommentAction
userInteractionCount:0
External Links {π}(3)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net