Skip to content

Commit

Permalink
working on conda workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JarryShaw committed Apr 22, 2023
1 parent 0ea3f01 commit 6e68244
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/conda-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

name: Build and upload conda packages

on:
release:
types: ['released', 'prereleased']

# workflow_dispatch: # Un comment line if you also want to trigger action manually

jobs:
conda_deployment_with_new_tag:
name: Conda deployment of package with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Conda environment creation and activation
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: util/conda-build.yaml # Path to the build conda environment
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Build and upload the conda packages
uses: uibcdf/[email protected]
with:
meta_yaml_dir: .
python-version: ${{ matrix.python-version }} # Values previously defined in `matrix`
platform_linux-64: true
platform_osx-64: true
platform_win-64: true
user: jarryshaw
label: auto
token: ${{ secrets.ANACONDA_TOKEN }} # Replace with the right name of your secret
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@
"ttlv",
"ttol",
"tunnelid",
"uibcdf",
"undoc",
"upid",
"urgp",
Expand Down
49 changes: 49 additions & 0 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% set name = "pypcapkit" %}
#{% set version = "1.0.0b9" %}

package:
name: "PyPCAPKit"
version: "{{ environ['GIT_DESCRIBE_TAG'] }}"

#source:
# url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
# sha256: 6789d9aa44564091a4fdeaf65c694303c1b5a16474568842aa9ca9d931aac448

source:
git_url: https://github.com/JarryShaw/PyPCAPKit.git
git_rev: "{{ environ['GIT_DESCRIBE_TAG'] }}"
git_depth: 1 # (Defaults to -1/not shallow)

build:
number: 1
entry_points:
- pcapkit-cli = pcapkit.__main__:main
- pcapkit-vendor = pcapkit.vendor.__main__:main
script: "{{ PYTHON }} -m pip install .[all] -vv"

requirements:
build:
- git
host:
- pip
- python
run:
- python

test:
imports:
- pcapkit

about:
home: https://jarryshaw.github.io/PyPCAPKit
license: BSD 3-Clause License
license_family: BSD
license_file:
- LICENSE
summary: "PyPCAPKit: comprehensive network packet analysis library"
doc_url: https://jarryshaw.github.io/PyPCAPKit
dev_url: https://github.com/jarryshaw/pypcapkit

extra:
recipe-maintainers:
- jarryshaw
3 changes: 0 additions & 3 deletions pcapkit/const/arp/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
class Hardware(IntEnum):
"""[Hardware] Hardware Types [:rfc:`826`][:rfc:`5494`]"""

#: Reserved [:rfc:`5494`]
Reserved_0 = 0

#: Ethernet (10Mb) [Jon Postel]
Ethernet = 1

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ authors = [
{ name="Jarry Shaw", email="[email protected]" },
]
maintainers = [
{ name="Jarry Shaw", email="[email protected]" },
{ name="Jarry Shaw" },
]
license = { text="BSD 3-Clause License" }
requires-python = ">=3.6, <4"
Expand Down
8 changes: 8 additions & 0 deletions util/conda-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
channels: # write here the list of channels to look for your library dependencies
- uibcdf
- conda-forge
- default

dependencies: # Keep this block with only these two packages
- anaconda-client
- conda-build

0 comments on commit 6e68244

Please sign in to comment.