Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test suite, reorganize to platform classes #26

Merged
merged 10 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
tox_env:
- dev
- pkg_check
- types
- type
- docs
exclude:
- { os: windows, tox_env: pkg_check }
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ platformdirs 2.1.0
- Drop Python 2.7 and 3.5 support
- Android support
- Add type annotations
- Reorganize project layout to platform specific classes, see
:class:`PlatformDirsABC <platformdirs.api.PlatformDirsABC>` and it's implementations:
:class:`Android <platformdirs.android.Android>`, :class:`MacOS <platformdirs.macos.MacOS>`,
:class:`Unix <platformdirs.unix.Unix>` and :class:`Windows <platformdirs.windows.Windows>`

platformdirs 2.0.2
------------------
Expand Down
40 changes: 33 additions & 7 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
API
===

.. note::
On Unix / Linux, we follow the `XDG Basedir Spec`_. The spec allows overriding
directories with environment variables. The examples show are the default
values, alongside the name of the environment variable that overrides them.

See the spec itself for further details on the topic.

.. _XDG Basedir Spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Platforms
gaborbernat marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~

Android
-------
.. autoclass:: platformdirs.android.Android
:members:
:show-inheritance:


macOS
-----
.. autoclass:: platformdirs.macos.MacOS
:members:
:show-inheritance:

Unix (Linux)
------------
.. autoclass:: platformdirs.unix.Unix
:members:
:show-inheritance:

Windows
-------
.. autoclass:: platformdirs.windows.Windows
:members:
:show-inheritance:

ABC
---
.. autoclass:: platformdirs.api.PlatformDirsABC
:members:
:special-members: __init__

User directories
~~~~~~~~~~~~~~~~
Expand Down
10 changes: 10 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
# "sphinx_autodoc_typehints",
]
html_theme = "furo"

autodoc_default_options = {
"member-order": "bysource",
"undoc-members": True,
}
default_role = "any"
autodoc_typehints = "signature"
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
5 changes: 2 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
platformdirs's documentation
============================

`platformdirs` is a library to determine platform-specific system directories.
``platformdirs`` is a library to determine platform-specific system directories.
This includes directories where to place cache files, user data, configuration,
etc.

Expand All @@ -10,8 +10,7 @@ The source code and issue tracker are both hosted on `GitHub`_.
.. _GitHub: https://github.com/platformdirs/platformdirs

.. toctree::
:maxdepth: 2
:caption: Contents:
:maxdepth: 3

api
changelog
Expand Down
8 changes: 7 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ where = src

[options.extras_require]
docs =
Sphinx>=4.1.1,<5.0.0
Sphinx>=4
furo>=2021.7.5b38
proselint>=0.10.2
sphinx-autodoc-typehints>=1.12
test =
appdirs@https://github.com/ActiveState/appdirs/archive/8eacfa312d77aba28d483fbfb6f6fc54099622be.zip
pytest>=6
pytest-cov>=2.7
pytest-mock>=3.6

[options.package_data]
platformdirs = py.typed
Expand Down Expand Up @@ -89,6 +91,10 @@ skip_empty = true

[mypy]
python_version = 3.9
warn_unused_ignores = False

[mypy-appdirs.*]
ignore_missing_imports = True

[mypy-jnius.*]
ignore_missing_imports = True
Loading