Skip to content

Commit

Permalink
setup: switch mostly to glob import
Browse files Browse the repository at this point in the history
The long import list in autorelease.py seemed not tolerable anymore and
changing to dotted access too tedious.

So switch all to glob import, except setup_base, which doesn't import
much.
  • Loading branch information
mara004 committed Sep 29, 2023
1 parent 88281ae commit 60ff803
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 88 deletions.
25 changes: 2 additions & 23 deletions setupsrc/pypdfium2_setup/autorelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,8 @@

sys.path.insert(0, str(Path(__file__).parents[1]))
from pypdfium2_setup import update_pdfium
# CONSIDER glob import or dotted access
from pypdfium2_setup.packaging_base import (
run_cmd,
set_versions,
get_version_ns,
get_full_version,
get_latest_version,
get_changelog_staging,
Host,
DataTree,
SourceTree,
PDFium_URL,
RepositoryURL,
Changelog,
ChangelogStaging,
VersionFile,
VerNamespace,
BindingsFileName,
AutoreleaseDir,
MajorUpdateFile,
BetaUpdateFile,
RefBindingsFile,
)
# TODO consider dotted access?
from pypdfium2_setup.packaging_base import *


# these files/dirs do not necessarily need to have been changed, `git add` silently skips that
Expand Down
15 changes: 2 additions & 13 deletions setupsrc/pypdfium2_setup/build_pdfium.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,8 @@
from pathlib import Path, WindowsPath

sys.path.insert(0, str(Path(__file__).parents[1]))
# CONSIDER glob import or dotted access
from pypdfium2_setup.packaging_base import (
Host,
SB_Dir,
DataTree,
PDFium_URL,
DepotTools_URL,
LibnameForSystem,
VerStatusFileName,
PlatformNames,
run_cmd,
call_ctypesgen,
)
# TODO consider dotted access?
from pypdfium2_setup.packaging_base import *


PatchDir = SB_Dir / "patches"
Expand Down
18 changes: 2 additions & 16 deletions setupsrc/pypdfium2_setup/craft_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,8 @@
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parents[1]))
# CONSIDER glob import or dotted access
from pypdfium2_setup.packaging_base import (
run_cmd,
clean_platfiles,
get_latest_version,
Host,
ModuleDir,
BindingsFileName,
LibnameForSystem,
BinaryPlatforms,
SourceTree,
BinarySpec_EnvVar,
BinarySpec_V8Indicator,
BinarySpec_VersionSep,
PlatformTarget_None,
)
# TODO consider dotted access?
from pypdfium2_setup.packaging_base import *


class ArtifactStash:
Expand Down
22 changes: 2 additions & 20 deletions setupsrc/pypdfium2_setup/emplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,8 @@
sys.path.insert(0, str(Path(__file__).parents[1]))

from pypdfium2_setup import update_pdfium
from pypdfium2_setup.packaging_base import (
# CONSIDER glob import or dotted access
Host,
DataTree,
BinarySpec_EnvVar,
BinarySpec_VersionSep,
BinarySpec_V8Indicator,
PlatformTarget_Auto,
PlatformTarget_None,
VersionTarget_Latest,
VerStatusFileName,
V8StatusFileName,
PlatformNames,
get_platfiles,
clean_platfiles,
emplace_platfiles,
get_latest_version,
read_version_file,
purge_pdfium_versions,
)
# TODO consider dotted access?
from pypdfium2_setup.packaging_base import *


# CONSIDER Linux/macOS: check that minimum OS version requirements are fulfilled
Expand Down
2 changes: 1 addition & 1 deletion setupsrc/pypdfium2_setup/setup_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from wheel.bdist_wheel import bdist_wheel

sys.path.insert(0, str(Path(__file__).parents[1]))
# CONSIDER glob import or dotted access
# TODO consider glob import or dotted access
from pypdfium2_setup.packaging_base import (
VerNamespace,
LibnameForSystem,
Expand Down
17 changes: 2 additions & 15 deletions setupsrc/pypdfium2_setup/update_pdfium.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,8 @@

sys.path.insert(0, str(Path(__file__).parents[1]))
from pypdfium2_setup._compat import safer_tar_unpack
# CONSIDER glob import or dotted access
from pypdfium2_setup.packaging_base import (
DataTree,
VerStatusFileName,
V8StatusFileName,
ReleaseNames,
BinaryPlatforms,
ReleaseURL,
SystemNames,
LibnameForSystem,
plat_to_system,
get_latest_version,
get_full_version,
call_ctypesgen,
)
# TODO consider dotted access?
from pypdfium2_setup.packaging_base import *


def clear_data(download_files):
Expand Down

0 comments on commit 60ff803

Please sign in to comment.