Skip to content

Commit

Permalink
Vendor ssh2-python as a submodule
Browse files Browse the repository at this point in the history
In another attempt to circumvent the restrictions from PyPI, I am adding
a submodule for my fork of ssh2-python and adding that as a local build
requirement.
  • Loading branch information
JacobCallahan committed Mar 6, 2024
1 parent 0767e25 commit d1599b7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand All @@ -48,9 +50,12 @@ jobs:
- name: Unit Tests
env:
BROKER_DIRECTORY: "${{ github.workspace }}/broker_dir"
PWD: "${{ github.workspace }}"
run: |
pip install -U pip
pip install -U .[dev,docker]
pip install uv
uv venv
source .venv/bin/activate
uv pip install -e .[dev,docker]
ls -l "$BROKER_DIRECTORY"
broker --version
pytest -v tests/ --ignore tests/functional
9 changes: 8 additions & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup and Build
env:
PWD: "${{ github.workspace }}"
run: |
pip install -U pip .[setup]
pip install uv
uv venv
source .venv/bin/activate
uv pip install -e .[setup]
python -m build
python -m twine check dist/*
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "broker/vendored/ssh2-python"]
path = broker/vendored/ssh2-python
url = https://github.com/jacobcallahan/ssh2-python.git
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
FROM fedora
MAINTAINER https://github.com/SatelliteQE

ENV PWD /root/broker

RUN dnf -y install make cmake gcc-c++ zlib-devel \
openssl-devel git python3-pip python3-devel \
openssl-devel git python3-pip python3-devel which\
&& dnf clean all
WORKDIR /root/broker
COPY . /root/broker/

RUN pip install .

WORKDIR $PWD
COPY . $PWD

RUN pip install uv
RUN uv pip install -e .

ENTRYPOINT ["broker"]
CMD ["--help"]
1 change: 1 addition & 0 deletions broker/vendored/ssh2-python
Submodule ssh2-python added at abbbf8
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"packaging",
"pyyaml",
"setuptools",
"ssh2-python@git+https://github.com/jacobcallahan/ssh2-python.git",
"ssh2-python @ file://${PWD}/broker/vendored/ssh2-python",
]
dynamic = ["version"] # dynamic fields to update on build - version via setuptools_scm

Expand All @@ -53,7 +53,7 @@ setup = [
"build",
"twine",
]
ssh2 = ["ssh2-python@git+https://github.com/jacobcallahan/ssh2-python.git"]
# ssh2 = ["ssh2-python@git+https://github.com/jacobcallahan/ssh2-python.git"]
ssh2_py311 = ["ssh2-python"]

[project.scripts]
Expand Down

0 comments on commit d1599b7

Please sign in to comment.