Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package with Poetry #218

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,39 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Update pip
run: |
python -m pip install --upgrade pip
# Per the Poetry installation instructions here: https://github.com/marketplace/actions/install-poetry-action
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-0 # increment to reset cache
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m pip install -e .[dev]
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Test with pytest
run: |
source .venv/bin/activate
pytest
41 changes: 32 additions & 9 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,42 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
- name: Update pip
run: |
python -m pip install --upgrade pip
pip install build
# Per the Poetry installation instructions here: https://github.com/marketplace/actions/install-poetry-action
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-0 # increment to reset cache
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Build package
run: python -m build
run: poetry build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ repos:
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.11
language_version: python3.11
965 changes: 965 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Poetry configuration file. https://python-poetry.org/
[virtualenvs]
in-project = true
48 changes: 43 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
[build-system]
requires = [
"setuptools >= 40.9.0",
"wheel",
[tool.poetry]
name = "schemachange"
version = "3.6.1"
description = "A Database Change Management tool for Snowflake"
authors = [
"jamesweakley <https://github.com/jamesweakley>",
"jeremiahhansen <https://github.com/jeremiahhansen>"
]
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/Snowflake-Labs/schemachange"
packages = [{ include = "schemachange" }]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
]
build-backend = "setuptools.build_meta"

[metadata]
license-file = "LICENSE"

[tool.poetry.scripts]
schemachange = 'schemachange.cli:main'

[tool.poetry.dependencies]
python = ">=3.8"
jinja2 = ">=3.0,<4.0"
pandas = ">=1.3,<2.0"
pyyaml = ">=6.0,<7.0"
snowflake-connector-python = ">=2.8,<4.0"
requests = "^2.31.0"
cryptography = "^41.0.7"


[tool.poetry.group.dev.dependencies]
black = "^23.12.1"
pytest = "^7.4.4"
flake8 = "5.0.4"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
41 changes: 41 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
asn1crypto==1.5.1 ; python_version >= "3.8"
black==23.12.1 ; python_version >= "3.8"
certifi==2023.11.17 ; python_version >= "3.8"
cffi==1.16.0 ; python_version >= "3.8"
charset-normalizer==3.3.2 ; python_version >= "3.8"
click==8.1.7 ; python_version >= "3.8"
colorama==0.4.6 ; python_version >= "3.8" and (sys_platform == "win32" or platform_system == "Windows")
cryptography==41.0.7 ; python_version >= "3.8"
exceptiongroup==1.2.0 ; python_version < "3.11" and python_version >= "3.8"
filelock==3.13.1 ; python_version >= "3.8"
flake8==5.0.4 ; python_version >= "3.8"
idna==3.6 ; python_version >= "3.8"
iniconfig==2.0.0 ; python_version >= "3.8"
jinja2==3.1.2 ; python_version >= "3.8"
markupsafe==2.1.3 ; python_version >= "3.8"
mccabe==0.7.0 ; python_version >= "3.8"
mypy-extensions==1.0.0 ; python_version >= "3.8"
numpy==1.24.4 ; python_version >= "3.8" and python_version < "3.9"
numpy==1.26.3 ; python_version >= "3.9"
packaging==23.2 ; python_version >= "3.8"
pandas==1.5.3 ; python_version >= "3.8"
pathspec==0.12.1 ; python_version >= "3.8"
platformdirs==3.11.0 ; python_version >= "3.8"
pluggy==1.3.0 ; python_version >= "3.8"
pycodestyle==2.9.1 ; python_version >= "3.8"
pycparser==2.21 ; python_version >= "3.8"
pyflakes==2.5.0 ; python_version >= "3.8"
pyjwt==2.8.0 ; python_version >= "3.8"
pyopenssl==23.3.0 ; python_version >= "3.8"
pytest==7.4.4 ; python_version >= "3.8"
python-dateutil==2.8.2 ; python_version >= "3.8"
pytz==2023.3.post1 ; python_version >= "3.8"
pyyaml==6.0.1 ; python_version >= "3.8"
requests==2.31.0 ; python_version >= "3.8"
six==1.16.0 ; python_version >= "3.8"
snowflake-connector-python==3.6.0 ; python_version >= "3.8"
sortedcontainers==2.4.0 ; python_version >= "3.8"
tomli==2.0.1 ; python_version < "3.11" and python_version >= "3.8"
tomlkit==0.12.3 ; python_version >= "3.8"
typing-extensions==4.9.0 ; python_version >= "3.8"
urllib3==1.26.18 ; python_version >= "3.8"
31 changes: 27 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
Jinja2~=3.0
pandas~=1.3
PyYAML~=6.0
snowflake-connector-python>=2.8,<4.0
asn1crypto==1.5.1 ; python_version >= "3.8"
certifi==2023.11.17 ; python_version >= "3.8"
cffi==1.16.0 ; python_version >= "3.8"
charset-normalizer==3.3.2 ; python_version >= "3.8"
cryptography==41.0.7 ; python_version >= "3.8"
filelock==3.13.1 ; python_version >= "3.8"
idna==3.6 ; python_version >= "3.8"
jinja2==3.1.2 ; python_version >= "3.8"
markupsafe==2.1.3 ; python_version >= "3.8"
numpy==1.24.4 ; python_version >= "3.8" and python_version < "3.9"
numpy==1.26.3 ; python_version >= "3.9"
packaging==23.2 ; python_version >= "3.8"
pandas==1.5.3 ; python_version >= "3.8"
platformdirs==3.11.0 ; python_version >= "3.8"
pycparser==2.21 ; python_version >= "3.8"
pyjwt==2.8.0 ; python_version >= "3.8"
pyopenssl==23.3.0 ; python_version >= "3.8"
python-dateutil==2.8.2 ; python_version >= "3.8"
pytz==2023.3.post1 ; python_version >= "3.8"
pyyaml==6.0.1 ; python_version >= "3.8"
requests==2.31.0 ; python_version >= "3.8"
six==1.16.0 ; python_version >= "3.8"
snowflake-connector-python==3.6.0 ; python_version >= "3.8"
sortedcontainers==2.4.0 ; python_version >= "3.8"
tomlkit==0.12.3 ; python_version >= "3.8"
typing-extensions==4.9.0 ; python_version >= "3.8"
urllib3==1.26.18 ; python_version >= "3.8"
33 changes: 0 additions & 33 deletions setup.cfg

This file was deleted.

Loading