Skip to content

Commit

Permalink
Merge pull request #282 from jacebrowning/add-universtal-startfile
Browse files Browse the repository at this point in the history
Replace custom code with universal-startfile
  • Loading branch information
jacebrowning committed Aug 15, 2022
2 parents a0bed9f + 42eae34 commit 050a4fe
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 99 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
# 3.3 (beta)

- Replaced custom file openers with [universal-startfile](https://github.com/jacebrowning/universal-startfile).

# 3.2 (2022-04-08)

- Added support for locking dependencies to specific versions. (@Erich-McMillan)
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Expand Up @@ -77,6 +77,7 @@ typed-ast==1.4.3; python_version < "3.8" and implementation_name == "cpython" an
types-freezegun==1.1.7
types-setuptools==57.4.11
typing-extensions==3.10.0.2; python_version >= "3.7" and python_version < "3.8" and python_full_version >= "3.6.2"
universal-startfile==0.1; python_version >= "3.7" and python_version < "4.0"
urllib3==1.26.9; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.6"
watchdog==2.1.7; python_version >= "3.7"
wrapt==1.14.0; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.5"
Expand Down
5 changes: 3 additions & 2 deletions gitman/commands.py
Expand Up @@ -3,8 +3,9 @@
import datetime

import log
from startfile import startfile

from . import common, system
from . import common
from .decorators import preserve_cwd
from .models import Config, Source, find_nested_configs, load_config

Expand Down Expand Up @@ -364,7 +365,7 @@ def edit(*, root=None):
log.error("No config found")
return False

return system.launch(config.path)
return startfile(config.path)


def _display_result(modify, modified, count, allow_zero=False):
Expand Down
37 changes: 0 additions & 37 deletions gitman/system.py

This file was deleted.

20 changes: 0 additions & 20 deletions gitman/tests/test_system.py

This file was deleted.

60 changes: 36 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
@@ -1,7 +1,7 @@
[tool.poetry]

name = "gitman"
version = "3.2"
version = "3.3b1"
description = "A language-agnostic dependency manager using Git."

license = "MIT"
Expand Down Expand Up @@ -46,6 +46,7 @@ python = "^3.7"

datafiles = "^1.2"
minilog = "^2.1"
universal-startfile = "*"

[tool.poetry.dev-dependencies]

Expand Down
16 changes: 1 addition & 15 deletions tests/test_cli.py
Expand Up @@ -34,7 +34,7 @@ def it_prints_location_by_default(show, location):
expect(show.mock_calls) == [call(location, color="path")]

@patch("gitman.common.show")
def it_can_print_a_depenendcy_path(show, location):
def it_can_print_a_dependency_path(show, location):
cli.main(["show", "bar"])

expect(show.mock_calls) == [call(os.path.join(location, "bar"), color="path")]
Expand All @@ -44,17 +44,3 @@ def it_exits_when_no_config_found(tmpdir):

with expect.raises(SystemExit):
cli.main(["show"])


def describe_edit():
@patch("gitman.system.launch")
def it_launches_the_config(launch, config):
cli.main(["edit"])

expect(launch.mock_calls) == [call(config), call().__bool__()]

def it_exits_when_no_config_found(tmpdir):
tmpdir.chdir()

with expect.raises(SystemExit):
cli.main(["edit"])

0 comments on commit 050a4fe

Please sign in to comment.