Skip to content

Commit 176d57c

Browse files
committedJun 7, 2023
debugging conda workflow
1 parent 11b5650 commit 176d57c

11 files changed

+50
-92
lines changed
 

‎.github/workflows/create-release.yml

+25-5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,27 @@ jobs:
102102
ref: v${{ needs.version_check.outputs.PCAPKIT_VERSION }}
103103
fetch-depth: 0
104104

105+
- name: Reset Build Number
106+
run: |
107+
set -x
108+
109+
echo 0 > conda/build
110+
111+
- name: Commit Changes
112+
run: |
113+
set -x
114+
115+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
116+
git config --local user.name "github-actions[bot]"
117+
118+
git add conda/build
119+
git commit -m"Reset conda build number"
120+
121+
- name: Push Changes
122+
uses: ad-m/github-push-action@master
123+
with:
124+
github_token: ${{ secrets.PYPCAPKIT }}
125+
105126
- name: Create Tag
106127
run: |
107128
set -x
@@ -110,7 +131,7 @@ jobs:
110131
git config --local user.name "github-actions[bot]"
111132
git tag "conda-${{ needs.version_check.outputs.PCAPKIT_VERSION }}+0" -m"Conda Build"
112133
113-
- name: Push Changes
134+
- name: Push Tag
114135
uses: ad-m/github-push-action@master
115136
with:
116137
github_token: ${{ secrets.PYPCAPKIT }}
@@ -219,11 +240,10 @@ jobs:
219240
220241
- name: Setup Conda Distribution
221242
run: |
222-
export PCAPKIT_DEVMODE=1
223-
export PCAPKIT_VERBOSE=1
243+
set -x
224244
225-
echo 0 > conda/build
226-
python util/conda-dist.py
245+
mkdir -p conda/wheels
246+
python -m pip download -r conda/requirements.txt -d conda/wheels
227247
228248
- name: Conda environment creation and activation
229249
uses: conda-incubator/setup-miniconda@v2

‎.github/workflows/cron-conda.yml

+3-33
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,11 @@ on:
77
branches: [main, ]
88

99
jobs:
10-
get-version:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v3
14-
with:
15-
fetch-depth: 0
16-
17-
- uses: actions/setup-python@v4
18-
with:
19-
python-version: '3.11'
20-
21-
- name: Install and Setup
22-
run: |
23-
set -x
24-
25-
python -m pip install -U pip setuptools wheel
26-
python -m pip install -e .
27-
28-
- name: Get Version
29-
id: get_version
30-
run: |
31-
set -x
32-
33-
echo "PCAPKIT_VERSION=$(python -c 'import pcapkit; print(pcapkit.__version__)')" >> $GITHUB_OUTPUT
34-
35-
outputs:
36-
PCAPKIT_VERSION: ${{ steps.get_version.outputs.PCAPKIT_VERSION }}
37-
3810
conda-update:
3911
runs-on: ubuntu-latest
40-
needs: [ get-version ]
4112
steps:
4213
- uses: actions/checkout@v3
4314
with:
44-
ref: v${{ needs.get-version.outputs.PCAPKIT_VERSION }}
4515
fetch-depth: 0
4616

4717
- uses: actions/setup-python@v4
@@ -164,10 +134,10 @@ jobs:
164134
165135
- name: Setup Conda Distribution
166136
run: |
167-
export PCAPKIT_DEVMODE=1
168-
export PCAPKIT_VERBOSE=1
137+
set -x
169138
170-
python util/conda-dist.py
139+
mkdir -p conda/wheels
140+
python -m pip download -r conda/requirements.txt -d conda/wheels
171141
172142
- name: Conda environment creation and activation
173143
uses: conda-incubator/setup-miniconda@v2

‎.github/workflows/cron-vendor.yml

-31
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,10 @@ on:
77
branches: [main, ]
88

99
jobs:
10-
get-version:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v3
14-
with:
15-
fetch-depth: 0
16-
17-
- uses: actions/setup-python@v4
18-
with:
19-
python-version: '3.11'
20-
21-
- name: Install and Setup
22-
run: |
23-
set -x
24-
25-
python -m pip install -U pip setuptools wheel
26-
python -m pip install -e .
27-
28-
- name: Get Version
29-
id: get_version
30-
run: |
31-
set -x
32-
33-
echo "PCAPKIT_VERSION=$(python -c 'import pcapkit; print(pcapkit.__version__)')" >> $GITHUB_OUTPUT
34-
35-
outputs:
36-
PCAPKIT_VERSION: ${{ steps.get_version.outputs.PCAPKIT_VERSION }}
37-
3810
vendor-update:
3911
runs-on: macos-latest
40-
needs: [ get-version ]
4112
steps:
4213
- uses: actions/checkout@v3
43-
with:
44-
ref: v${{ needs.get-version.outputs.PCAPKIT_VERSION }}
4514

4615
- uses: actions/setup-python@v4
4716
with:

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ release
2828
/VERSION
2929

3030
pcapkit/_extern
31+
conda/wheels/
3132

3233
# Created by https://www.gitignore.io/api/macos,python,visualstudiocode
3334

‎MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ prune test
1414
include README.rst
1515
include LICENSE
1616

17+
include pcapkit/_extern
1718
exclude pcapkit/protocols/*/NotImplemented

‎Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ docs-clean:
4545
isort:
4646
pipenv run isort -l100 -ppcapkit --skip-glob '**/__init__.py' pcapkit temp/sort.py
4747
pipenv run isort -l100 -ppcapkit pcapkit/{const,vendor}/*/*.py
48+
pipenv run isort -l100 -ppcapkit util/*.py
4849

4950
vermin:
5051
pipenv run vermin pcapkit --backport argparse --backport enum --backport importlib --backport ipaddress --backport typing --backport typing_extensions --no-parse-comments --eval-annotations -vv pcapkit > temp/vermin.txt

‎conda/pypcapkit/build.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
$PYTHON -m pip install conda/wheels/* --target pcapkit/_extern -vv
6+
$PYTHON -m pip install . -vv

‎conda/pypcapkit/meta.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ package:
77
version: "{{ version }}"
88

99
source:
10-
git_url: https://github.com/JarryShaw/PyPCAPKit.git
11-
git_rev: "conda-{{ version }}+{{ build_number }}"
12-
git_depth: 1 # (Defaults to -1/not shallow)
10+
path: ../..
11+
#git_url: https://github.com/JarryShaw/PyPCAPKit.git
12+
#git_rev: "conda-{{ version }}+{{ build_number }}"
13+
#git_depth: 1 # (Defaults to -1/not shallow)
1314

1415
build:
1516
number: {{ build_number }}
1617
entry_points:
1718
- pcapkit-cli = pcapkit.__main__:main
1819
- pcapkit-vendor = pcapkit.vendor.__main__:main
19-
script: "{{ PYTHON }} -m pip install . -vv"
20+
#script: "{{ PYTHON }} -m pip install . -vv"
2021

2122
requirements:
2223
build:

‎conda/requirements.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
aenum==3.1.12
22
appdirs==1.4.4
3-
43
beautifulsoup4==4.12.2
54
certifi==2023.5.7
65
chardet==5.1.0
76
charset-normalizer==3.1.0
87
dictdumper==0.8.4.post2
98
dpkt==1.9.8
10-
emoji==2.4.0
9+
emoji==2.2.0
1110
html5lib==1.1
1211
idna==3.4
1312
lxml==4.9.2
1413
packaging==23.1
1514
pathlib2==2.3.7.post1
1615

16+
17+
1718
pyshark==0.6
1819
pysocks==1.7.1
19-
requests==2.31.0
20+
requests==2.30.0
2021
scapy==2.5.0
2122
six==1.16.0
2223
soupsieve==2.4.1
2324
tbtrim==0.3.1
2425
termcolor==2.3.0
25-
typing-extensions==4.6.3
26+
typing-extensions==4.5.0
2627
urllib3==2.0.2
2728
webencodings==0.5.1

‎util/bump_version.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# -*- coding: utf-8 -*-
22

33
import os
4-
import pkg_resources
54
from typing import TYPE_CHECKING, cast
65

6+
import pkg_resources
7+
78
if TYPE_CHECKING:
89
from packaging.version import Version
910

‎util/conda-dist.py

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# -*- coding: utf-8 -*-
22

33
import os
4-
import sys
4+
55
import pkg_resources
6-
import subprocess # nosec B404
76

87
req_file = os.path.join('conda', 'requirements.txt')
98

@@ -17,15 +16,3 @@
1716
with open(req_file, 'w') as file:
1817
for key, value in sorted(data.items()):
1918
print(f'{key}=={value}', file=file)
20-
21-
try:
22-
import pcapkit
23-
path = os.path.join(pcapkit.__path__[0], '_extern')
24-
except ImportError:
25-
path = os.path.join('pcapkit', '_extern')
26-
os.makedirs(path, exist_ok=True)
27-
28-
subprocess.check_call([ # nosec B603
29-
sys.executable, '-m', 'pip', 'install',
30-
'--target', path, '-r', req_file,
31-
])

0 commit comments

Comments
 (0)
Please sign in to comment.