probberechts / soccerdata

⛏⚽ Scrape soccer data from Club Elo, ESPN, FBref, FiveThirtyEight, Football-Data.co.uk, FotMob, Sofascore, SoFIFA, Understat and WhoScored.
https://soccerdata.readthedocs.io/en/latest/
Other
597 stars 103 forks source link

[Nox] Documentation sessions create a ~ directory #479

Closed JanVanHaaren closed 7 months ago

JanVanHaaren commented 7 months ago

The docs and docs-build Nox sessions create a ~ directory on my machine, which I believe is unintentional.

https://github.com/probberechts/soccerdata/blob/a565388b1cb359e25ad1a902059fb947ea559831/noxfile.py#L190

https://github.com/probberechts/soccerdata/blob/a565388b1cb359e25ad1a902059fb947ea559831/noxfile.py#L204

The tilde (~) is not expanded to my home directory, where my soccerdata directory is located.

Potential solutions include using Path.home() as is done elsewhere, using os.path.expanduser, and using BASE_DIR from _config.py. Depending on which solution is most desirable, I can create a pull request to address this issue.

probberechts commented 7 months ago

I remember that there was a good reason to use the default '~/soccerdata' instead of the value in _config.py which might be overridden by an environment variable. However, I forgot the reason 🤔

Replacing '~' with Path.home() would be a good solution. Feel free to create a PR. Otherwise I can easily fix this myself.