spotipy/CONTRIBUTING.md
Brennan Pate d92951b356
Update Directions In TUTORIAL.md; Add Unit Tests To non_user_endpoints test.py (#1136)
* Update navigational directions in Step 1(A)

* Combine directions in Step 1(B) and Step 2(C) and remove Step 2(C)

* Update navigational directions and verbage in Step 1(C)

* Change reference from Step 1(C) to Step 1(B) in Step 2(D)

* Update capitalization in Prerequisites Step 3

* Add directions for installing Spotipy in Prerequisites Step 1(A)

* List updates to TUTORIAL.md file in CHANGELOG.md

* Update docstrings for funcs in lines 340-585

* Add unit tests for artist ID and URL

* Add test_artists_mixed_ids

* Updated CHANGELOG.md and TUTORIAL.md as requested

* Update client.py and test.py

* Fix linting issue

* Remove duplicate line; Change order of prerequisites

* Update local repo

* Add test_artists_mixed_ids

* Add Radiohead ID and URL; Add qotsa URL

* Add test_artist_url

* Comment out three failing tests

* Fix linting errors

* Uncommenting out failed tests

* Add test_artist_id

* List changes in CHANGELOG.md

* Add line breaks at the end of files.

* Remove multiple spaces

Also I've removed a sentence that just doesn't make sense in my eyes, but was added before this PR.

---------

Co-authored-by: Niko <github@dieserniko.link>
2024-06-22 17:35:53 +02:00

1.8 KiB

Contributing

If you would like to contribute to spotipy follow these steps:

Export the needed environment variables

# Linux or Mac
export SPOTIPY_CLIENT_ID=client_id_here
export SPOTIPY_CLIENT_SECRET=client_secret_here
export SPOTIPY_CLIENT_USERNAME=client_username_here # This is actually an id not spotify display name and can be found [here](https://www.spotify.com/us/account/overview/)
export SPOTIPY_REDIRECT_URI=http://localhost:8080 # Make url is set in app you created to get your ID and SECRET

# Windows
$env:SPOTIPY_CLIENT_ID="client_id_here"
$env:SPOTIPY_CLIENT_SECRET="client_secret_here"
$env:SPOTIPY_CLIENT_USERNAME="client_username_here" 
$env:SPOTIPY_REDIRECT_URI="http://localhost:8080" 

Create virtual environment, install dependencies, run tests:

$ virtualenv --python=python3 env
$ source env/bin/activate
(env) $ pip install -e . 
(env) $ python -m unittest discover -v tests

Lint

To automatically fix the code style:

pip install autopep8
autopep8 --in-place --aggressive --recursive .

To verify the code style:

pip install flake8
flake8 .

To make sure if the import lists are stored correctly:

pip install isort
isort . -c -v

Changelog

Don't forget to add a short description of your change in the CHANGELOG

Publishing (by maintainer)

  • Bump version in setup.py

  • Bump and date changelog

  • Add to changelog:

    ## Unreleased
    Add your changes below.
    
    ### Added
    
    ### Fixed
    
    ### Removed
    
  • Commit changes

  • Push tag to trigger PyPI build & release workflow

  • Create github release https://github.com/plamere/spotipy/releases with the changelog content for the version and a short name that describes the main addition

  • Verify doc uses latest https://readthedocs.org/projects/spotipy/