Skip to content

Commit

Permalink
pull request feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat committed Sep 1, 2018
1 parent 1c250af commit 4c2cd09
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
rev: v1.0.1
hooks:
- id: seed-isort-config
args: [--application-directories, src]
args: [--application-directories, "src:."]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
hooks:
Expand Down
6 changes: 3 additions & 3 deletions src/tox/_pytestplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ def initproj_(nameversion, filedefs=None, src_root=".", add_missing_setup_py=Tru
{
name: {
"__init__.py": textwrap.dedent(
"""
\"\"\" module {} \"\"\"
__version__ = {!r}"""
'''
""" module {} """
__version__ = {!r}'''
)
.strip()
.format(name, version)
Expand Down
5 changes: 4 additions & 1 deletion src/tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,11 @@ def __init__(self, config, inipath): # noqa

config.skipsdist = reader.getbool("skipsdist", all_develop)
config.isolated_build = reader.getbool("isolated_build", False)
config.isolated_build_package_env = reader.getstring(
"isolated_build_package_env", ".package"
)
if config.isolated_build is True:
name = ".package"
name = config.isolated_build_package_env
if name not in config.envconfigs:
config.envconfigs[name] = self.make_envconfig(
name, testenvprefix + name, reader._subs, config
Expand Down
7 changes: 2 additions & 5 deletions src/tox/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def make_sdist_legacy(report, config, session):

def build_isolated(config, report, session):
build_info = get_build_info(config.setupdir, report)
package_venv = session.getvenv(".package")
package_venv = session.getvenv(config.isolated_build_package_env)
package_venv.envconfig.deps_matches_subset = True

package_venv.envconfig.deps = [DepConfig(r, None) for r in build_info.requires]
Expand Down Expand Up @@ -180,10 +180,7 @@ def perform_isolated_build(build_info, package_venv, session, config):
import {}
basename = {}.build_{}({!r}, {{ "--global-option": ["--formats=gztar"]}})
print(basename)""".format(
build_info.backend_module,
build_info.backend_object,
"sdist",
str(config.distdir),
build_info.backend_module, build_info.backend_object, "sdist", str(config.distdir)
)
)
config.distdir.ensure_dir()
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_package_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def test_package_isolated_build_flit(initproj, cmd):
env = os.environ.copy()
env["GIT_COMMITTER_NAME"] = "committer joe"
env["GIT_AUTHOR_NAME"] = "author joe"
env["EMAIL"] = "joe@bloomberg.com"
env["EMAIL"] = "joe@example.com"
subprocess.check_call(["git", "init"], env=env)
subprocess.check_call(["git", "add", "-A", "."], env=env)
subprocess.check_call(["git", "commit", "-m", "first commit"], env=env)
subprocess.check_call(["git", "commit", "-m", "first commit", "--no-gpg-sign"], env=env)
result = cmd("--sdistonly")
assert result.ret == 0, result.out

Expand Down
4 changes: 2 additions & 2 deletions tests/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ def wrapper(fn):
try:
subprocess.check_output(check_cmd)
except OSError:
return pytest.mark.skip(reason="%s is not available" % name)(fn)
return pytest.mark.skip(reason="{} is not available".format(name))(fn)
return fn

return wrapper


def need_git(fn):
return pytest.mark.mercurial(need_executable("git", ("git", "--version"))(fn))
return pytest.mark.git(need_executable("git", ("git", "--version"))(fn))
4 changes: 1 addition & 3 deletions tests/unit/test_pytest_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ def test_broken_py_path_local_join_workaround_on_Windows(self, tmpdir, initproj,


def linesep_bytes():
if isinstance(os.linesep, bytes):
return os.linesep
return os.linesep.encode("utf-8")
return os.linesep.encode()


class TestPathParts:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ include_trailing_comma = True
force_grid_wrap = 0
line_length = 99
known_first_party = tox,tests
known_third_party = apiclient,git,httplib2,oauth2client,packaging,pkg_resources,pluggy,py,pytest,setuptools,six,tests,toml
known_third_party = apiclient,git,httplib2,oauth2client,packaging,pkg_resources,pluggy,py,pytest,setuptools,six,toml
[testenv:release]
description = do a release, required posarg of the version number
Expand Down

0 comments on commit 4c2cd09

Please sign in to comment.