Cite your sources
Publications should refer to PsychoPy in the method section, and also Pavlovia if you ran the experiment online.
For example:
The experiment was created using PsychoPy Builder (Peirce et al., 2019) and hosted on Pavlovia (Open Science Tools Ltd., Nottingham, UK). To ensure consistent stimulus sizes across different devices, participants were asked to place a credit card on the screen and resize an image to match (Morys-Carter, 2023). The task that followed displayed 5cm tall Navon figures with a variable number of local items (Morys-Carter, 2021).
Morys-Carter, W.L. (2021, December 8). Navon figures [Computer software]. Pavlovia. https://pavlovia.org/vespr/navon-figures
Morys-Carter, W. L. (2023, July 4). ScreenScale [Computer software]. Pavlovia. https://doi.org/10.17605/OSF.IO/8FHQK
Peirce, J. W., Gray, J. R., Simpson, S., MacAskill, M. R., Höchenberger, R., Sogo, H., Kastman, E., Lindeløv, J. (2019). PsychoPy2: experiments in behavior made easy. Behavior Research Methods. https://dx.doi.org/10.3758/s13428-018-01193-y
Note that in one case I have included a link to the GitLab repository and in the other I created a DOI by uploading a copy of the code to OSF.
To encourage researchers to reuse my code, I set the visibility of the project on GitLab to public and add a licence (GNU General Public License v3.0). If you want to use software set to public on GitLab which doesn’t have a licence you should try to contact the original author and ask them to add one.
If you are only using someone else’s code to help you write or debug your own code, but do not use a substantive portion of it, then you do not need to add a reference, but you could acknowledge their contribution. People sometimes acknowledge me rather than cite me when incorporating my ScreenScale routine. A citation is definitely preferred. On the other hand, I wouldn’t expect a citation from someone who has been guided to an approach in their own code by looking at, for example, my Independent Randomisation online demo.