Skip to content

Commit

Permalink
⚙️ Migrating to pyproject.toml and flit (#173)
Browse files Browse the repository at this point in the history
* bump version and change description

* add pyproject.toml

* remove legacy package files

* fix package description

* adapt workflows to use flit

* update documentation URL

* fix project dependencies

* fix requests dep

* fix tinydb dep
  • Loading branch information
sserrata authored Oct 18, 2021
1 parent 333bed6 commit 2686e8a
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 125 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -25,15 +25,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
pip install .[test]
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest
pytest
9 changes: 4 additions & 5 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install flit
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
flit publish
4 changes: 2 additions & 2 deletions pan_cortex_data_lake/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

"""Main package for cortex."""
"""Python idiomatic SDK for Cortex™ Data Lake."""

__author__ = "Palo Alto Networks"
__version__ = "2.0.0-a14"
__version__ = "2.0.0b1"

from .exceptions import ( # noqa: F401
CortexError,
Expand Down
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "pan-cortex-data-lake"
keywords = [
"cortex",
"data",
"lake",
"datalake",
"sdk",
"api",
"palo alto networks",
]
authors = [
{name = "Steven Serrata", email = "sserrata@paloaltonetworks.com"},
]
maintainers = [
{name = "Steven Serrata", email = "sserrata@paloaltonetworks.com"},
{name = "Developer Relations", email = "devrel@paloaltonetworks.com"},
]
readme = "README.md"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: ISC License (ISCL)",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
]
license = {file = "LICENSE"}
requires-python = ">=3.5"
dynamic = ["version", "description"]
dependencies = [
"requests >=2",
"tinydb >=3,<4"
]

[project.optional-dependencies]
test = [
"pytest >=2.7.3",
"pytest-cov",
"flake8",
"tox",
"coverage",
]

[project.urls]
Home = "https://cortex.pan.dev"
Source = "https://github.com/PaloAltoNetworks/pan-cortex-data-lake-python"
Documentation = "https://cortex.pan.dev/docs/develop/cdl_python_installation"

[tool.flit.module]
name = "pan_cortex_data_lake"

30 changes: 0 additions & 30 deletions requirements.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements_dev.txt

This file was deleted.

22 changes: 0 additions & 22 deletions setup.cfg

This file was deleted.

56 changes: 0 additions & 56 deletions setup.py

This file was deleted.

0 comments on commit 2686e8a

Please sign in to comment.