Skip to content

Commit

Permalink
Replace the dead appdirs dependency by platformdirs (#811)
Browse files Browse the repository at this point in the history
Co-authored-by: James Hewitt <james.hewitt@gmail.com>
  • Loading branch information
mwerlen and Jamstah committed Apr 24, 2024
1 parent e0ea9d2 commit 342dd6a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -16,6 +16,7 @@ The format mostly follows [Keep a Changelog](http://keepachangelog.com/en/1.0.0/

- Remove EOL'd Python 3.7 (new minimum requirement is Python 3.8), add Python 3.12 testing
- Adds optional `reply_to` option for email reporters (#794 by trevorshannon)
- Replace the dead dependency `appdirs` with `platformdirs` (#811 by Maxime Werlen)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion docs/source/dependencies.rst
Expand Up @@ -15,7 +15,7 @@ Mandatory Packages
- `minidb <https://thp.io/2010/minidb/>`__
- `requests <http://python-requests.org/>`__
- `keyring <https://github.com/jaraco/keyring/>`__
- `appdirs <https://github.com/ActiveState/appdirs>`__
- `platformdirs <https://github.com/platformdirs/platformdirs>`__
- `lxml <https://lxml.de>`__
- `cssselect <https://cssselect.readthedocs.io>`__

Expand Down
6 changes: 3 additions & 3 deletions lib/urlwatch/cli.py
Expand Up @@ -35,14 +35,14 @@
import signal
import sys

from appdirs import AppDirs
from platformdirs import PlatformDirs

pkgname = 'urlwatch'
urlwatch_dir = os.path.expanduser(os.path.join('~', '.' + pkgname))
urlwatch_cache_dir = AppDirs(pkgname).user_cache_dir
urlwatch_cache_dir = PlatformDirs(pkgname).user_cache_dir

if not os.path.exists(urlwatch_dir):
urlwatch_dir = AppDirs(pkgname).user_config_dir
urlwatch_dir = PlatformDirs(pkgname).user_config_dir

# Check if we are installed in the system already
(prefix, bindir) = os.path.split(os.path.dirname(os.path.abspath(sys.argv[0])))
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -2,6 +2,6 @@ pyyaml
minidb >= 2.0.6
requests
keyring
appdirs
platformdirs
lxml
cssselect
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -17,7 +17,7 @@
m['name'] = 'urlwatch'
m['author'], m['author_email'] = re.match(r'(.*) <(.*)>', m['author']).groups()
m['description'], m['long_description'] = docs[0].strip().split('\n\n', 1)
m['install_requires'] = ['minidb>=2.0.6', 'PyYAML', 'requests', 'keyring', 'appdirs', 'lxml', 'cssselect']
m['install_requires'] = ['minidb>=2.0.6', 'PyYAML', 'requests', 'keyring', 'platformdirs', 'lxml', 'cssselect']
if sys.platform == 'win32':
m['install_requires'].extend(['colorama'])
m['entry_points'] = {"console_scripts": ["urlwatch=urlwatch.cli:main"]}
Expand Down

0 comments on commit 342dd6a

Please sign in to comment.