Skip to content

Commit

Permalink
release first dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Oct 10, 2024
1 parent 5049d1e commit 8211bf3
Show file tree
Hide file tree
Showing 10 changed files with 1,031 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/_pkg_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

name: 'Package - Build'
run-name: 'Package: Build from ${{github.ref}}'


on:
workflow_dispatch:
push:
paths:
- 'pyproject.toml'

jobs:

publish-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: PyPI
steps:
- name: 'Checkout repository from ${{github.ref}}'
uses: actions/checkout@v4

- name: 'Build sdist'
run: |
pipx run build --sdist --wheel --outdir dist/
- name: 'Upload package'
uses: pypa/gh-action-pypi-publish@release/v1
# https://github.com/marketplace/actions/pypi-publish
with:
packages-dir: dist
verify-metadata: false
verbose: true
print-hash: true
skip-existing: false

publish-testpypi:
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: TestPyPI
steps:
- name: 'Checkout repository from ${{github.ref}}'
uses: actions/checkout@v4

- name: 'Build sdist'
run: |
pipx run build --sdist --wheel --outdir dist/
- name: 'Upload package'
uses: pypa/gh-action-pypi-publish@release/v1
# https://github.com/marketplace/actions/pypi-publish
with:
packages-dir: dist
repository-url: https://test.pypi.org/legacy/
verify-metadata: false
verbose: true
print-hash: true
skip-existing: false
149 changes: 149 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Ref: https://github.com/github/gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/website/_build/
docs/website/source/api/_autosummary

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
# There are reports this comes from LLVM profiling, but also Xcode 9.
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# profraw files from LLVM? Unclear exactly what triggers this
# There are reports this comes from LLVM profiling, but also Xcode 9.
*profraw

# In-tree generated files
*/_version.py

# VSCode
.vscode/

# PyCharm
.idea/

# MacOS system files
.DS_Store

# PyPackIT
data/_local_reports/
data/_cache/
!/dev/build/
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

[build-system]
requires = ["setuptools>=61.0", "versioningit"]
build-backend = "setuptools.build_meta"


# ----------------------------------------- setuptools -------------------------------------------
[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools.packages.find]
where = ["src"]
namespaces = true


# ----------------------------------------- Project Metadata -------------------------------------
#
[project]
version = "0.0.0.dev1"
name = "LicenseMan"
requires-python = ">=3.10"
dependencies = [
"LoggerMan == 0.0.0.dev49",
"PyLinks",
"PkgData",
"MDit == 0.0.0.dev20",
"ExceptionMan == 0.0.0.dev20",
]
Empty file added src/licenseman/__init__.py
Empty file.
29 changes: 29 additions & 0 deletions src/licenseman/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Functions for retrieving package data files."""

from __future__ import annotations as _annotations

from pathlib import Path as _Path

import pkgdata as _pkgdata

__all__ = ["get"]


def get(relative_path: str) -> _Path:
"""Get the absolute path to a package data file.
Parameters
----------
relative_path
Path to the file relative to the package's data directory.
"""
path_data_dir = _Path(_pkgdata.get_package_path_from_caller(top_level=False))
filepath = path_data_dir / relative_path
if not filepath.is_file():
from licenseman.exception.data import DataFileNotFoundError

raise DataFileNotFoundError(
path_relative=relative_path,
path_absolute=filepath,
)
return filepath
1 change: 1 addition & 0 deletions src/licenseman/data/__test_file__
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a test file used by our test suite to verify that package data is being included correctly.
Loading

0 comments on commit 8211bf3

Please sign in to comment.