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

chore: more small changes from #361 #477

Merged
merged 6 commits into from
May 24, 2022
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
2 changes: 0 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
API Documentation
=================

This project exposes 2 modules:

``build`` module
----------------

Expand Down
8 changes: 7 additions & 1 deletion src/build/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def __init__(
The default runner simply calls the backend hooks in a subprocess, writing backend output
to stdout/stderr.
"""
self.srcdir: str = os.path.abspath(srcdir)
self._srcdir: str = os.path.abspath(srcdir)
_validate_source_directory(srcdir)

spec_file = os.path.join(srcdir, 'pyproject.toml')
Expand Down Expand Up @@ -319,6 +319,11 @@ def _runner(
extra_environ['PATH'] = os.pathsep.join(paths)
self._hook_runner(cmd, cwd, extra_environ)

@property
def srcdir(self) -> str:
"""Project source directory."""
return self._srcdir

@property
def python_executable(self) -> str:
"""
Expand Down Expand Up @@ -509,6 +514,7 @@ def log(message: str) -> None:

__all__ = [
'__version__',
'BuildSystemTableValidationError',
'BuildBackendException',
'BuildException',
'ConfigSettingsType',
Expand Down
9 changes: 6 additions & 3 deletions src/build/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
from build.env import IsolatedEnvBuilder


__all__ = ['build', 'main', 'main_parser']


_COLORS = {
'red': '\33[91m',
'green': '\33[92m',
Expand Down Expand Up @@ -386,3 +383,9 @@ def entrypoint() -> None:

if __name__ == '__main__': # pragma: no cover
main(sys.argv[1:], 'python -m build')


__all__ = [
'main',
'main_parser',
]
6 changes: 3 additions & 3 deletions src/build/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
virtualenv = None


_logger = logging.getLogger('build.env')
_logger = logging.getLogger(__name__)


class IsolatedEnv(metaclass=abc.ABCMeta):
Expand Down Expand Up @@ -330,7 +330,7 @@ def _find_executable_and_scripts(path: str) -> Tuple[str, str, str]:
return executable, paths['scripts'], paths['purelib']


__all__ = (
__all__ = [
'IsolatedEnvBuilder',
'IsolatedEnv',
)
]
4 changes: 3 additions & 1 deletion src/build/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ def project_wheel_metadata(
return _project_wheel_metadata(builder)


__all__ = ('project_wheel_metadata',)
__all__ = [
'project_wheel_metadata',
]