Skip to content

Commit

Permalink
Merge pull request #10 from luizirber/lirber/packaging
Browse files Browse the repository at this point in the history
Add pyproject.toml and packaging config
  • Loading branch information
jeff-cohere authored Oct 21, 2024
2 parents bd83fb8 + a4e81f2 commit b96ce5a
Show file tree
Hide file tree
Showing 5 changed files with 922 additions and 12 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ jobs:
- name: Show action trigger
run: echo "= The job was automatically triggered by a ${{github.event_name}} event."

- name: Setting up Python 3.12
uses: actions/setup-python@v5
- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.12"
version: "0.4.x"
enable-cache: true

- name: Installing dtspy dependencies (${{ matrix.os }})
run: python3 -m pip install -r requirements.txt
- name: Install Python 3.12
run: uv python install 3.12

- name: Build
run: mkdocs build --verbose
run: uv run --dev mkdocs build --verbose

- if: ${{ github.event_name == 'push' }}
name: GitHub Pages action
Expand Down
43 changes: 37 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive

- name: Setting up Python 3.12 (${{ matrix.os }})
uses: actions/setup-python@v5
- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.12"
version: "0.4.x"
enable-cache: true

- name: Installing dtspy dependencies (${{ matrix.os }})
run: python3 -m pip install -r requirements.txt
- name: Install Python 3.12
run: uv python install 3.12

- name: Running tests (${{ matrix.os }})
run: coverage run -m unittest discover
run: uv run --dev coverage run -m unittest discover
env:
DTS_KBASE_DEV_TOKEN: ${{ secrets.DTS_KBASE_DEV_TOKEN }}

Expand All @@ -46,3 +47,33 @@ jobs:
# uses: codecov/[email protected]
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

publish:
runs-on: ubuntu-latest

# Steps for running tests and analysis.
steps:
- name: Checking out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.x"
enable-cache: true

- name: Install Python 3.12
run: uv python install 3.12

- name: Build package
run: uv build

- name: Check package can be imported
run: uv run --with dist/dtspy-*-py3-none-any.whl --no-project -- python -c "import dts"

# when ready to upload to PyPI
# name: upload to PyPI
# run: uv publish
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
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"]
build-backend = "setuptools.build_meta"

[project]
name = "dtspy"
version = "0.1.0"
description = "Python client for the Data Transfer Service"
authors = [
{ name = "Jeffrey N. Johnson", email = "[email protected]" },
]
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"frictionless>=5.17.0,<6",
"requests>=2.32.3,<3",
]

[tool.uv]
dev-dependencies = [
# testing
"coverage >=7.6.3,<8",

# docs
"mkdocs-material>=9.5.41",
"mkdocs>=1.6.1",
"mkdocstrings-python>=1.12.1",
"mkdocstrings>=0.26.2",
]
Loading

0 comments on commit b96ce5a

Please sign in to comment.