Skip to content

Commit

Permalink
modernize with pyproject, use scm for version
Browse files Browse the repository at this point in the history
  • Loading branch information
ischneider committed Oct 18, 2024
1 parent 5491c76 commit 439764c
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 89 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.12
- name: Pip cache
uses: actions/cache@v2
with:
Expand All @@ -26,15 +26,15 @@ jobs:
nox -s lint
analyze:
name: Analyze Typing
name: Analyze Typing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.12
- name: Pip cache
uses: actions/cache@v2
with:
Expand All @@ -53,7 +53,7 @@ jobs:

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Checkout code
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.12
- name: Pip cache
uses: actions/cache@v2
with:
Expand All @@ -106,7 +106,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.12
- name: Pip cache
uses: actions/cache@v2
with:
Expand All @@ -118,5 +118,3 @@ jobs:
run: |
pip install --upgrade nox
nox -s docs
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def coverage(session):
session.run('coverage', 'report')


@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
def test(session):
session.run('python', '-m', 'ensurepip', '--upgrade')
session.install('-U', 'setuptools')
Expand Down
4 changes: 3 additions & 1 deletion planet/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = '2.11.0dev'
from importlib.metadata import version

__version__ = version("planet")
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "planet"
authors = [ {name = "Planet", email = "python-sdk-contributors@planet.com"} ]
description = "Planet SDK for Python"
dependencies = [
"click>=8.0",
"geojson",
"httpx>=0.23.0",
"jsonschema",
"pyjwt>=2.1",
"tqdm>=4.56",
"typing-extensions",
]
readme = "README.md"
requires-python = ">=3.9"
keywords = ["planet", "api", "sdk", "client"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Topic :: Utilities",
]
license = {file = "LICENSE"}
dynamic = ["version"]

[project.optional-dependencies]
test = [
"pytest",
"anyio",
"pytest-cov",
"respx>=0.20",
]
lint = [
"flake8",
"mypy",
"yapf",
]
docs = [
"mkdocs==1.3",
"mkdocs-click==0.7.0",
"mkdocs-material==8.2.11",
"mkdocstrings==0.18.1",
"mkdocs_autorefs==1.0.1",
]
dev = [
"planet[test, docs, lint]",
]

[project.scripts]
planet = "planet.cli.cli:main"

[project.urls]
Repository = "https://github.com/planetlabs/planet-client-python"

[tool.setuptools_scm]
12 changes: 9 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
[metadata]
license_file: LICENSE
[options]
packages = planet, planet.cli, planet.clients, planet.data

[options.packages.find]
exclude = examples, tests

; [options.package_data]
; planet = data/*

[tool:pytest]
addopts =
-rxXs

[coverage:run]
source = planet,tests
source = planet, tests
branch = True

[coverage:report]
Expand Down
78 changes: 2 additions & 76 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,80 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from pathlib import Path
from setuptools import setup, find_packages
from setuptools import setup

with open('planet/__version__.py') as f:
for line in f:
if line.find("__version__") >= 0:
version = line.split("=")[1].strip()
version = version.strip('"')
version = version.strip("'")
continue

install_requires = [
'click>=8.0',
'geojson',
'httpx>=0.23.0',
'jsonschema',
'pyjwt>=2.1',
'tqdm>=4.56',
'typing-extensions',
]

test_requires = ['pytest', 'anyio', 'pytest-cov', 'respx>=0.20']

lint_requires = ['flake8', 'mypy', 'yapf']

doc_requires = [
'mkdocs==1.3',
'mkdocs-click==0.7.0',
'mkdocs-material==8.2.11',
'mkdocstrings==0.18.1',
'mkdocs_autorefs==1.0.1',
]

setup(
name='planet',
version=version,
description=u"Planet SDK for Python",
long_description=Path("README.md").read_text("utf-8"),
long_description_content_type="text/markdown",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering',
'Topic :: Software Development',
'Topic :: Utilities'
],
keywords='planet api sdk client',
author='Planet',
maintainer='Planet',
maintainer_email='python-sdk-contributors@planet.com',
url='https://github.com/planetlabs/planet-client-python',
license='Apache 2.0',
packages=find_packages(exclude=['examples', 'tests']),
package_data={
"": ["LICENSE", "CONTRIBUTING.md"],
"planet": ["data/*"],
},
include_package_data=True,
zip_safe=False,
python_requires='>=3.7',
install_requires=install_requires,
extras_require={
'test': test_requires,
'lint': lint_requires,
'docs': doc_requires,
'dev': test_requires + lint_requires + doc_requires
},
entry_points={
'console_scripts': [
'planet=planet.cli.cli:main',
],
},
)
setup()

0 comments on commit 439764c

Please sign in to comment.