Merge pull request #10073 from Kache/main
Clarify writing_plugins naming instructions
This commit is contained in:
		
						commit
						d2a206683c
					
				
							
								
								
									
										1
									
								
								AUTHORS
								
								
								
								
							
							
						
						
									
										1
									
								
								AUTHORS
								
								
								
								
							| 
						 | 
					@ -187,6 +187,7 @@ Katarzyna Jachim
 | 
				
			||||||
Katarzyna Król
 | 
					Katarzyna Król
 | 
				
			||||||
Katerina Koukiou
 | 
					Katerina Koukiou
 | 
				
			||||||
Keri Volans
 | 
					Keri Volans
 | 
				
			||||||
 | 
					Kevin C
 | 
				
			||||||
Kevin Cox
 | 
					Kevin Cox
 | 
				
			||||||
Kevin J. Foley
 | 
					Kevin J. Foley
 | 
				
			||||||
Kian Eliasi
 | 
					Kian Eliasi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -158,18 +158,20 @@ it in your setuptools-invocation:
 | 
				
			||||||
    # sample ./setup.py file
 | 
					    # sample ./setup.py file
 | 
				
			||||||
    from setuptools import setup
 | 
					    from setuptools import setup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name_of_plugin = "myproject"  # register plugin with this name
 | 
				
			||||||
    setup(
 | 
					    setup(
 | 
				
			||||||
        name="myproject",
 | 
					        name="myproject",
 | 
				
			||||||
        packages=["myproject"],
 | 
					        packages=["myproject"],
 | 
				
			||||||
        # the following makes a plugin available to pytest
 | 
					        # the following makes a plugin available to pytest
 | 
				
			||||||
        entry_points={"pytest11": ["name_of_plugin = myproject.pluginmodule"]},
 | 
					        entry_points={"pytest11": [f"{name_of_plugin} = myproject.pluginmodule"]},
 | 
				
			||||||
        # custom PyPI classifier for pytest plugins
 | 
					        # custom PyPI classifier for pytest plugins
 | 
				
			||||||
        classifiers=["Framework :: Pytest"],
 | 
					        classifiers=["Framework :: Pytest"],
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If a package is installed this way, ``pytest`` will load
 | 
					If a package is installed this way, ``pytest`` will load
 | 
				
			||||||
``myproject.pluginmodule`` as a plugin which can define
 | 
					``myproject.pluginmodule`` as a plugin which can define
 | 
				
			||||||
:ref:`hooks <hook-reference>`.
 | 
					:ref:`hooks <hook-reference>`. Confirm registration with ``pytest --trace-config``
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. note::
 | 
					.. note::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue