Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503,D212,D202,D205,D415
select = B,B9,C,D,DAR,F,N,RST,S,W
ignore = E,RST201,RST203,RST301,W503,D212,D202,D205,D415
max-line-length = 80
max-complexity = 10
max-complexity = 16
docstring-convention = google
per-file-ignores = tests/*:S101
rst-roles = class,const,func,meth,mod,ref
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ jobs:

- name: Run Nox
run: |
nox --force-color --python=${{ matrix.python }}
if [[ "${{ matrix.session }}" == "tests" ]]; then
# Run all tests including destructive ones in CI
nox --force-color --python=${{ matrix.python }} -- --destructive
else
nox --force-color --python=${{ matrix.python }}
fi

- name: Upload coverage data
if: always() && matrix.session == 'tests'
Expand Down
8 changes: 6 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ MOPUp is the mac\ **O**\ S **P**\ ython.org **Updater**.

If you prefer to use the binary installers from python.org, it's easy to forget
to update them. This is a program that does that; it updates them. Just ``pip
install mopup`` into a virtualenv using the Python you are using, run ``mopup``
install mopup`` into a virtualenv using the Python you are using, run ``mopup update``
and provide your password when prompted. An administrator password is required,
because the python.org binary installers require admin privileges.

Normally, it does this using a CLI in the background, but if you'd prefer, you
can run it with ``--interactive`` for it to launch the usual macOS GUI
can run it with ``mopup update --interactive=true`` for it to launch the usual macOS GUI
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops I guess that shows how often I used that option…

Installer app.

You can also uninstall Python versions with ``mopup uninstall <version>`` (e.g.,
``mopup uninstall 3.14``). Use ``--dry-run=true`` to see what would be removed
without actually removing anything.

Installation
------------

Expand Down
48 changes: 48 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
Usage
=====

Updating Python
---------------

Update your currently running Python version to its latest patch
release, also known as a micro release (for example from 3.13.2
to 3.13.7)::

mopup update

Upgrade your currently running Python to a newer minor release
(for example from 3.13 to 3.14)::

mopup update --minor=true

Update Python using the GUI installer::

mopup update --interactive=true

Check for updates without installing (dry run)::

mopup update --dry-run=true

Uninstalling Python
-------------------

Uninstalling with MOPUp removes all files and directories installed by
a specific Python.org installer. It will also remove any Python packages
installed within that Python version's ``site-packages`` directory.

However, it will refuse to uninstall if it detects extra files or
directories within that installation that were not listed by the
installer's manifest or any installed Python package's ``.dist-info``.

Uninstall a specific Python version::

mopup uninstall 3.14

Preview what would be uninstalled without actually removing::

mopup uninstall 3.14 --dry-run=true

Force uninstall even if extra files are present::

mopup uninstall 3.14 --force=true

Command Reference
-----------------

.. click:: mopup.__main__:main
:prog: mopup
:nested: full
4 changes: 3 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ def mypy(session: Session) -> None:

@session(python=python_versions)
def tests(session: Session) -> None:
"""Run the test suite."""
"""Run the test suite (non-destructive tests only)."""
session.install(".")
session.install("coverage[toml]", "pytest", "pygments")

# conftest.py now handles skipping destructive tests by default
try:
session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs)
finally:
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ source = ["mopup", "tests"]
show_missing = true
fail_under = 50

[tool.pytest.ini_options]
markers = [
"destructive: marks tests as potentially destructive (deselect with '-m \"not destructive\"')",
]

[tool.mypy]
strict = true
warn_unreachable = true
Expand Down
Loading
Loading