Skip to content

Commit

Permalink
update setup.py to match certbot
Browse files Browse the repository at this point in the history
  • Loading branch information
mwt committed Aug 26, 2024
1 parent f15dfd0 commit 9aed03b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 3 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"setuptools>=41.6.0",
]

if not os.environ.get("SNAP_BUILD"):
if os.environ.get("SNAP_BUILD"):
install_requires.append("packaging")
else:
install_requires.extend(
[
# We specify the minimum acme and certbot version as the current plugin
Expand All @@ -21,12 +23,6 @@
f"certbot>={version}",
]
)
elif "bdist_wheel" in sys.argv[1:]:
raise RuntimeError(
"Unset SNAP_BUILD when building wheels " "to include certbot dependencies."
)
if os.environ.get("SNAP_BUILD"):
install_requires.append("packaging")

docs_extras = [
"Sphinx>=1.0", # autodoc_member_order = 'bysource', autodoc_default_flags
Expand Down
10 changes: 5 additions & 5 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ parts:
plugin: python
source: .
override-pull: |
craftctl default
craftctl set version=$(grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]")
craftctl default
craftctl set version=$(grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]")
build-environment:
# We set this environment variable while building to try and increase the
# stability of fetching the rust crates needed to build the cryptography
Expand All @@ -24,7 +24,7 @@ parts:
# used. This is done to let these constraints be applied not only on the certbot package
# build, but also on any isolated build that pip could trigger when building wheels for
# dependencies. See https://github.com/certbot/certbot/pull/8443 for more info.
- PIP_CONSTRAINT: $SNAPCRAFT_PART_SRC/snap-constraints.txt
# - PIP_CONSTRAINT: $SNAPCRAFT_PART_SRC/snap-constraints.txt
- SNAP_BUILD: "True"
# To build cryptography and cffi if needed
build-packages:
Expand All @@ -41,8 +41,8 @@ parts:
source: .
stage: [setup.py, certbot-shared]
override-pull: |
craftctl default
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
craftctl default
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
Expand Down

0 comments on commit 9aed03b

Please sign in to comment.