Skip to content

Commit

Permalink
Poetry as a package builder (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky authored Nov 3, 2022
1 parent e425ee7 commit 497347c
Show file tree
Hide file tree
Showing 16 changed files with 195 additions and 2,620 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

4 changes: 2 additions & 2 deletions .github/actions/pre-commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ runs:
using: "composite"
steps:
- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
pip install -e . && pip install -r requirements.txt -r requirements/e2e_requirements.txt
pip install ".[dev]"
shell: bash

- name: Run pre-commit
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/tests-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ runs:
using: "composite"
steps:
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -e . && pip install -r requirements/e2e_requirements.txt
pip install ".[dev,e2e]"
shell: bash

- name: List dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ runs:
using: "composite"
steps:
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -e . && pip install -r requirements/test_requirements.txt
pip install ".[dev]"
shell: bash

- name: List dependencies
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,22 @@ jobs:
uses: actions/checkout@v2

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Build and test
run: |
python setup.py sdist
- name: Install build dependencies
run: pip install poetry poetry-dynamic-versioning

- name: Build package
run: poetry build

- name: Uploading to test PyPI
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.5.1
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ wheels/
MANIFEST
VERSION

# Poetry
poetry.lock

# 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.
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## neptune-client 0.16.12

### Changes
- Building a package with Poetry ([#1069](https://github.com/neptune-ai/neptune-client/pull/1069))

## neptune-client 0.16.11

### Fixes
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

168 changes: 168 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,171 @@
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"
pattern = "default-unprefixed"

[tool.poetry.dependencies]
python = "^3.7"

# Python lack of functionalities from future versions
importlib-metadata = { version = "*", python = "<3.8" }
dataclasses = { version = ">=0.6", python = "<3.7" }

# Missing compatibility layer between Python 2 and Python 3
six = ">=1.12.0"
future = ">=0.17.1"

# Utility
packaging = "*"
click = ">=7.0"

# Networking
bravado = "^11.0.0"
oauthlib = ">=2.1.0"
PyJWT = "*"
requests = ">=2.20.0"
requests-oauthlib = ">=1.0.0"
websocket-client = ">=0.35.0, !=1.0.0"
urllib3 = "*"
swagger-spec-validator = ">=2.7.4"

# Built-in integrations
boto3 = ">=1.16.0"
Pillow = ">=1.1.6"
GitPython = ">=2.0.8"
psutil = "*"
pandas = "*"

# dev
altair = { version = "*", optional = true }
bokeh = { version = "*", optional = true }
freezegun = { version = "*", optional = true }
matplotlib = { version = "*", optional = true }
mock = { version = "*", optional = true }
moto = { version = "*", extras = [ "s3" ], optional = true }
munch = { version = "*", optional = true }
plotly = { version = "*", optional = true }
pre-commit = { version = "*", optional = true }
pytest = { version = "*", optional = true }
pytest-cov = { version = "*", optional = true }
pytest-mock = { version = "*", optional = true }
pytest-timeout = { version = "*", optional = true }
pytest-xdist = { version = "*", optional = true }
tensorflow = { version = "*", optional = true }
torch = { version = "*", optional = true }
vega_datasets = { version = "*", optional = true }

# e2e
Faker = { version = "*", optional = true }
optuna = { version = "*", optional = true }
sklearn = { version = "*", optional = true }
torchvision = { version = "*", optional = true }

# Additional integrations
kedro-neptune = { version = "*", optional = true }
neptune-fastai = { version = "*", optional = true }
neptune-lightgbm = { version = "*", optional = true }
pytorch-lightning = { version = "*", optional = true }
neptune-optuna = { version = "*", optional = true }
neptune-prophet = { version = "*", optional = true }
neptune-sacred = { version = "*", optional = true }
neptune-sklearn = { version = "*", optional = true }
neptune-tensorflow-keras = { version = "*", optional = true }
neptune-xgboost = { version = "*", optional = true }
transformers = { version = "*", optional = true }

[tool.poetry.extras]
fastai = ["neptune-fastai"]
kedro = ["kedro-neptune"]
lightgbm = ["neptune-lightgbm"]
optuna = ["neptune-optuna"]
prophet = ["neptune-prophet"]
pytorch-lightning = ["pytorch-lightning"]
sacred = ["neptune-sacred"]
sklearn = ["neptune-sklearn"]
tensorflow-keras = ["neptune-tensorflow-keras"]
transformers = ["transformers"]
xgboost = ["neptune-xgboost"]
dev = [
"altair",
"bokeh",
"freezegun",
"matplotlib",
"mock",
"moto[s3]",
"munch",
"plotly",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-mock",
"pytest-timeout",
"pytest-xdist",
"tensorflow",
"torch",
"vega_datasets",
]
e2e = [
"Faker",
# Integrations
"optuna",
"pytorch-lightning",
"sklearn",
"torchvision",
"transformers",
]

[tool.poetry]
authors = ["neptune.ai <contact@neptune.ai>"]
description = "Neptune Client"
repository = "https://github.com/neptune-ai/neptune-client"
homepage = "https://neptune.ai/"
documentation = "https://docs.neptune.ai/"
include = ["CHANGELOG.md"]
exclude = ["src/neptune/license_header.txt"]
license = "Apache License 2.0"
name = "neptune-client"
readme = "README.md"
version = "0.0.0"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
keywords = [
"MLOps",
"ML Experiment Tracking",
"ML Model Registry",
"ML Model Store",
"ML Metadata Store",
]
packages = [
{ include = "neptune", from = "src" },
{ include = "neptune_cli", from = "src" },
]

[tool.poetry.urls]
"Tracker" = "https://github.com/neptune-ai/neptune-client/issues"
"Source" = "https://github.com/neptune-ai/neptune-client"
"Documentation" = "https://docs.neptune.ai/"

[tool.poetry.scripts]
neptune = "neptune_cli.main:main"

[tool.black]
line-length = 120
target-version = ['py37', 'py38', 'py39', 'py310']
Expand Down
19 changes: 0 additions & 19 deletions requirements.txt

This file was deleted.

10 changes: 0 additions & 10 deletions requirements/e2e_requirements.txt

This file was deleted.

20 changes: 0 additions & 20 deletions requirements/test_requirements.txt

This file was deleted.

10 changes: 0 additions & 10 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit 497347c

Please sign in to comment.