Skip to content

Commit

Permalink
255 ga builds (#258)
Browse files Browse the repository at this point in the history
* reqa

- splitting up reqs into test and dev
- removing things that don't appear to be needed.

* Update pyproject.toml

- bump mac ports versions.

* Setup.py

- doing some clean up work
- adding more info prints that come in handy
- attempting to make this more robust. I suspect that on GA runners homebrew is also installed, but we aren't using it to install packages on MacOS builds. This can clear out the includes/libs/etc. This needs to be fixed, I have an idea 👍 . More coming soon.

* Update setup.py

- making vars global
- moved things down a bit.

* Update setup.py

- using temp vars for brew before final assignment at the end.

* Update setup.py

- added back the try catch

* Update setup.py

- convert to string before strip

* MacOS

- working to compile on macos without homebrew

* Update setup.py

- dynamic inlcudes for netsnmp

* Setup.py

- fixing a setup.py oops
- moving the sleep for test_snmpwalk and increasing it for macos.

* Update test_netsnmp.py

- black

* Update setup.py

- Another attempt for Linux

* MacOS

- MacOS fix attempt

* Workflows

- add concurrency to more flows
- made them depend on black before they run.

* Workflows

- making the tests workflows run again.

* Workflow

- optimizing workflows
- bumping the sleep time for that walk( test that timeouts on MacOS.

* Removing Black Dep

- turns out I can't have multiple triggers. Removed the black one. Keepign black in its own yml.

* Enable GA TestPyPi

- starting the test py pi

* try again for pypi

try again for pypi

* Update pyproject.toml

- maybe this will work for macos

* saving WIP

- turns out we need more functions to extract macports info.

* Mac Ports Builds

- getting mac port builds to work. Almost there.

* Update pyproject.toml

- try setting my env vars for macos

* Update pyproject.toml

- build from source... perhaps.

* Update setup.py

- remove RelinkLibraries, don't think it is needed anymore... ???>?>?

* Mac OS Workflow

- okay 1000 time is the charm... work now.

* Update pyproject.toml

- one more time

* Update pyproject.toml

- no zlib

* workflows

- revert and update both ppypi workflows

* Update build_and_publish_to_test_pypi.yml

- last minute revert from testing.
  • Loading branch information
carlkidcrypto authored Dec 15, 2024
1 parent fa31cfc commit 100d008
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 126 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/build_and_publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,30 @@ jobs:
with:
linux: python -m cibuildwheel --output-dir wheelhouse --platform linux;

macos: python -m cibuildwheel --output-dir wheelhouse --platform macos;
macos: |
MACOS_VERSION=$(sw_vers -productVersion)
if [[ "$MACOS_VERSION" == "10.15."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\110.15"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "11."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\111.0"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "12."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\112.0"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "13."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\113.0"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "14."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\114.0"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "15."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\115.0"/' pyproject.toml
else
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\110.15"/' pyproject.toml
fi
python -m cibuildwheel --output-dir wheelhouse --platform macos;
- uses: actions/upload-artifact@v4
with:
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/build_and_publish_to_test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,30 @@ jobs:
with:
linux: python -m cibuildwheel --output-dir wheelhouse --platform linux;

macos: python -m cibuildwheel --output-dir wheelhouse --platform macos;
macos: |
MACOS_VERSION=$(sw_vers -productVersion)
if [[ "$MACOS_VERSION" == "10.15."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\110.15"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "11."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\111.0"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "12."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\112.0"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "13."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\113.0"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "14."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\114.0"/' pyproject.toml
elif [[ "$MACOS_VERSION" == "15."* ]]; then
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\115.0"/' pyproject.toml
else
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\110.15"/' pyproject.toml
fi
python -m cibuildwheel --output-dir wheelhouse --platform macos;
- uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: "CodeQL"
on:
push:
branches: [ main ]

pull_request:
branches: [ main ]

schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * *'

jobs:
analyze:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Integration Tests

concurrency: integration_tests
on:
push:
branches: [ main ]
Expand Down Expand Up @@ -105,7 +105,6 @@ jobs:
uses: carlkidcrypto/[email protected]
with:
linux: |
export LD_LIBRARY_PATH=$(net-snmp-config --libdir | sed 's/-L//'):$LD_LIBRARY_PATH;
cd /home/runner/work/ezsnmp/ezsnmp/integration_tests;
./run_integration_tests.sh | grep "Total execution time:" > total_execution_time_${{matrix.os}}_${{matrix.python-version}}.log;
echo "artifactPath1=/home/runner/work/ezsnmp/ezsnmp/integration_tests/total_execution_time_${{matrix.os}}_${{matrix.python-version}}.log" >> $GITHUB_ENV;
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/tests_homebrew.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Tests With Homebrew Package Manager

concurrency: tests
on:
push:
branches: [ main ]
Expand Down Expand Up @@ -28,17 +28,10 @@ jobs:
tests/*.conf
setup.py
setup.cfg
lint-black-formatting:
runs-on: ubuntu-latest
needs: check-source-changes
steps:
- uses: actions/checkout@v4
- uses: psf/[email protected]
build-and-test:
runs-on: ${{ matrix.os }}
needs: lint-black-formatting
needs: check-source-changes
if: needs.check-source-changes.outputs.run_job == 'true'
strategy:
fail-fast: false
Expand Down Expand Up @@ -86,7 +79,7 @@ jobs:

- name: Install pip dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Build And Install EzSnmp
run: |
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/tests_native.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Tests With Native Package Manager

concurrency: tests
on:
push:
branches: [ main ]
Expand Down Expand Up @@ -28,17 +28,10 @@ jobs:
tests/*.conf
setup.py
setup.cfg
lint-black-formatting:
runs-on: ubuntu-latest
needs: check-source-changes
steps:
- uses: actions/checkout@v4
- uses: psf/[email protected]
build-and-test:
runs-on: ${{ matrix.os }}
needs: lint-black-formatting
needs: check-source-changes
if: needs.check-source-changes.outputs.run_job == 'true'
strategy:
fail-fast: false
Expand Down Expand Up @@ -71,11 +64,10 @@ jobs:

- name: Install pip dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Build And Install EzSnmp
run: |
export LD_LIBRARY_PATH=$(net-snmp-config --libdir | sed 's/-L//'):$LD_LIBRARY_PATH;
pip install . --verbose
- name: Start SNMP daemon
Expand Down
22 changes: 13 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,26 @@ before-all = """yum -y install wget;
./configure --with-defaults --disable-mibs --disable-manual --without-perl-modules --disable-embedded-perl;
make ;
make install ;"""
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}"

[tool.cibuildwheel.macos]
before-all = """mkdir -p $HOME/opt/mports;
environment = { PATH = "$HOME/opt/local/bin:$HOME/opt/local/sbin:$HOME/opt/local/include:$HOME/opt/local/lib:$PATH", MACOSX_DEPLOYMENT_TARGET = "15.0", DYLD_LIBRARY_PATH = "$HOME/opt/local/lib:$DYLD_LIBRARY_PATH" }
before-all = """
mkdir -p $HOME/opt/mports;
rm -rf $HOME/opt/mports/*;
cd $HOME/opt/mports;
wget https://github.com/macports/macports-base/releases/download/v2.10.2/MacPorts-2.10.2.tar.gz;
tar -xzvf MacPorts-2.10.2.tar.gz;
cd $HOME/opt/mports/MacPorts-2.10.2;
rm -f MacPorts-2.10.5.tar.gz;
curl -L https://github.com/macports/macports-base/releases/download/v2.10.5/MacPorts-2.10.5.tar.gz -o MacPorts-2.10.5.tar.gz;
tar -xzvf MacPorts-2.10.5.tar.gz;
cd $HOME/opt/mports/MacPorts-2.10.5;
./configure --prefix=$HOME/opt/local --with-install-user=`id -un` --with-install-group=`id -gn`;
make;
make install;
make distclean;
export PATH=$HOME/opt/local/bin:$HOME/opt/local/sbin:$PATH;
port selfupdate;
port clean net-snmp openssl;
port install net-snmp openssl;
port upgrade net-snmp openssl;"""
port -N selfupdate;
port -N clean net-snmp openssl;
port -N install net-snmp openssl;
port -N upgrade net-snmp openssl;"""
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"

[build-system]
Expand Down
7 changes: 0 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,13 @@ click== 8.1.7
colorama==0.4.6
coverage==7.6.8
flake8==7.1.1
iniconfig==2.0.0
mccabe==0.7.0
mypy-extensions==1.0.0
packaging==24.2
pathspec==0.12.1
platformdirs==4.3.6
pluggy==1.5.0
py==1.11.0
pycodestyle==2.12.1
pyflakes==3.2.0
pyparsing==3.2.0
pytest==8.3.4
pytest-cov==6.0.0
pytest-sugar==1.0.0
termcolor==2.5.0
tomli==2.2.1
setuptools==75.6.0
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[metadata]
name = ezsnmp
version = 2.0.0a3
description = A blazingly fast and Pythonic SNMP library based on the official Net-SNMP bindings.
We use SWIG to generate the wrapper code for us.
description = A blazingly fast and Pythonic SNMP library based on the official Net-SNMP bindings. We use SWIG to generate the wrapper code for us.
author = Carlos Santos
author_email = [email protected]
url = https://github.com/carlkidcrypto/ezsnmp
Expand Down
Loading

0 comments on commit 100d008

Please sign in to comment.