Skip to content

Commit

Permalink
feat: add conda-forge deployment (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCrab13 committed Nov 24, 2023
1 parent 23c2450 commit 0357d62
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 14 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ jobs:
skip-existing: true
verbose: true

- name: Build and publish to Conda-forge
uses: crabisoft/publish-conda@v1.0.0
if: steps.release.outputs.released == 'true'
with:
sub-directory: 'conda'
platforms: 'noarch'
token: ${{ secrets.ANACONDA_TOKEN }}


windows-build:
needs: [release]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
.conda

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Jacques Raphanel
Copyright (c) 2023 CrabiSoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ For guidelines for contributing to ``pdbstore``, refer to `CONTRIBUTING.rst <htt
:target: https://badge.fury.io/py/pdbstore
:alt: PyPI

.. |Conda| image:: https://img.shields.io/conda/v/conda-forge/pdbstore?label=Conda
:target: https://anaconda.org/conda-forge/pdbstore
:alt: Conda

.. |Read the Docs| image:: https://img.shields.io/readthedocs/pdbstore?label=Read%20the%20Docs&logo=Read%20the%20Docs
:target: https://pdbstore.readthedocs.org/en/latest
:alt: Docs
Expand Down
51 changes: 51 additions & 0 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{% set pyproject = load_file_data('pyproject.toml') %}

package:
name: pdbstore
version: {{ pyproject['project']['version'] }}

source:
path: ..

build:
noarch: python
number: 0
script: python setup.py install

requirements:
build:
{% for req in pyproject['project']['dependencies'] %}
- {{ req }}
{% endfor %}
run:
{% for req in pyproject['project']['dependencies'] %}
- {{ req }}
{% endfor %}

test:
source_files:
- pdbstore/
- tests/
- setup.py
imports:
- pdbstore
commands:
- pytest ./tests/unit
- pytest ./tests/cli
requires:
- mock
- coverage
- pytest==7.1.2
- pytest-cov
- pytest-subprocess
- wheel==0.41.2
- setuptools>=61.0.0

about:
home: {{ pyproject['project']['urls']['homepage'] }}
license: MIT
license_file: COPYING
summary: {{ pyproject['project']['description'] }}
dev_url: {{pyproject['project']['urls']['homepage'] }}
doc_url: {{ pyproject['project']['urls']['documentation'] }}
doc_source_url: {{ pyproject['project']['urls']['homepage'] + '/README.rst' }}
40 changes: 28 additions & 12 deletions pdbstore/io/file.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import struct
import ntpath
import os
import uuid
Expand Down Expand Up @@ -175,19 +176,34 @@ def extract_dbg_info(file_path: PathLike) -> Optional[Tuple[str, str]]:
pdb_filename = ntpath.basename(
code_view_entry.entry.PdbFileName.decode("utf-8")
)
guid = (
str(
uuid.UUID(
fields=(
code_view_entry.entry.Signature_Data1,
code_view_entry.entry.Signature_Data2,
code_view_entry.entry.Signature_Data3,
code_view_entry.entry.Signature_Data4,
code_view_entry.entry.Signature_Data5,
code_view_entry.entry.Signature_Data6_value,
)
)
if hasattr(code_view_entry.entry, 'Signature_Data5'):
# recent pefile version
fields=(
code_view_entry.entry.Signature_Data1,
code_view_entry.entry.Signature_Data2,
code_view_entry.entry.Signature_Data3,
code_view_entry.entry.Signature_Data4,
code_view_entry.entry.Signature_Data5,
code_view_entry.entry.Signature_Data6_value,
)
else:
# pragma: no cover
# old pefile version
Signature_Data4 = code_view_entry.entry.Signature_Data4[0]
Signature_Data5 = code_view_entry.entry.Signature_Data4[1]
Signature_Data6 = struct.unpack(
">Q", b"\0\0" + code_view_entry.entry.Signature_Data4[2:]
)[0]

fields=(
code_view_entry.entry.Signature_Data1,
code_view_entry.entry.Signature_Data2,
code_view_entry.entry.Signature_Data3,
Signature_Data4,
Signature_Data5,
Signature_Data6,
)
guid = (str(uuid.UUID(fields=fields))
.replace("-", "")
.upper()
+ f"{code_view_entry.entry.Age:X}"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pdbstore = "pdbstore.cli.cli:main"
[project.urls]
changelog = "https://github.com/crabisoft/pdbstore/blob/main/CHANGELOG.md"
documentation = "https://pdbstore.readthedocs.io"
homepage = "https://pdbstore.readthedocs.io"
homepage = "https://github.com/crabisoft/pdbstore"
issues = "https://github.com/crabisoft/pdbstore/issues"
repository = "http://github.com/crabisoft/pdbstore.git"

Expand Down

0 comments on commit 0357d62

Please sign in to comment.