Skip to content

Commit

Permalink
packaging updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrolexa committed Dec 16, 2024
1 parent 3b03b05 commit 18651b5
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 95 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/pythontest.yml

This file was deleted.

24 changes: 13 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Upload Python Package
name: PyPi Publisher

on:
release:
types: [created]
workflow_dispatch:
release:
types: [ published ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_APIKEY }}
pypi-publisher:
runs-on: ubuntu-latest
steps:
- uses: thevickypedia/pypi-publisher@v3
env:
token: ${{ secrets.PYPI_APIKEY }}
with:
python-version: "3.10"
skip-existing: true
36 changes: 36 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Python testing

on:
push:
branches:
- "**"
pull_request:

jobs:
build:
name: Testing on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# setuptools_scm requires a non-shallow clone of the repository
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Python package
run: |
python -m pip install .[test]
- name: Run Python tests
run: |
python -m pytest
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,3 @@ docs/notebooks/.ipynb_checkpoints/

# virtual environment
.venv

# pre-commit
.pre-commit-config.yaml
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-docstring-first
- id: check-illegal-windows-names
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
hooks:
- id: black
args: [--line-length=88]
exclude: ^(.venv/|docs/)
types: ["python"]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
args:
- --max-line-length=88
- --ignore=F401,E501,W503,E731,E743,E741,E203
exclude: ^(.venv/|docs/)
types: ["python"]

- repo: local
hooks:
- id: pytest
name: pytest
entry: ./.venv/bin/pytest
language: system
types: [python]
pass_filenames: false
always_run: true
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

APSG - The package for structural geologists.
Copyright (c) 2015-2024, Ondrej Lexa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ Install the **latest stable** version of APSG from PyPI:
pip install apsg
```

To include jupyterlab and pyqt5 in installation, use `extra` option:
```bash
pip install apsg[extra]
```

or install **master** with:
```bash
pip install git+https://github.com/ondrolexa/apsg.git
Expand Down
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,14 @@

# General information about the project.
project = "APSG"
copyright = "2024, Ondrej Lexa"
copyright = "2015-2024, Ondrej Lexa"

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
# the built documents.
#
# The short X.Y version.
version = importlib.metadata.version("apsg")
# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
77 changes: 36 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,58 +1,57 @@
[tool.poetry]
[project]
name = "apsg"
version = "1.3.0"
dynamic = ["version"]
description = "APSG - The package for structural geologists"
authors = ["Ondrej Lexa <[email protected]>"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/ondrolexa/apsg"
documentation = "https://apsg.readthedocs.io"
requires-python = ">=3.10"
license = { file = "LICENSE" }
keywords = ["structural geology", "stereonet", "orientation data"]
authors = [{ name = "Ondrej Lexa", email = "[email protected]" }]
maintainers = [{ name = "Ondrej Lexa", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
include = ["AUTHORS.md", "CHANGELOG.md", "CONTRIBUTING.md"]

[tool.poetry.dependencies]
python = "^3.10"
numpy = "^2.1"
matplotlib = "^3.9"
pyqt5 = "^5.15"
scipy = "^1.14"
sqlalchemy = "^1.3"
pandas = "^2.1"


[tool.poetry.group.docs.dependencies]
sphinx = "*"
ipykernel = "*"
nbsphinx = "*"


[tool.poetry.group.extra.dependencies]
jupyterlab = "^4"

dependencies = ["numpy", "matplotlib", "scipy", "sqlalchemy", "pandas"]

[project.optional-dependencies]
test = ["pytest"]
dev = [
"black",
"sphinx",
"sphinx_rtd_theme",
"readthedocs-sphinx-search",
"ipykernel",
"nbsphinx",
"autodocsumm",
]
extra = ["jupyterlab", "pyqt5"]

[tool.poetry.group.test.dependencies]
pytest = "*"
black = "*"
[project.urls]
Homepage = "https://github.com/ondrolexa/apsg"
Documentation = "https://apsg.readthedocs.io"
Repository = "https://github.com/ondrolexa/apsg.git"
Issues = "https://github.com/ondrolexa/apsg/issues"
Changelog = "https://github.com/ondrolexa/apsg/blob/master/CHANGELOG.md"

[tool.poetry.scripts]
[project.scripts]
iapsg = "apsg.shell:main"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/apsg"]

[tool.hatch.version]
path = "src/apsg/__init__.py"

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
/(
\.toml
Expand All @@ -61,7 +60,3 @@ exclude = '''
|\.ini
)/
'''

[[tool.poetry.source]]
name = "pypi-public"
url = "https://pypi.org/simple/"
3 changes: 1 addition & 2 deletions src/apsg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import importlib.metadata
from apsg.math import (
Vector3 as vec,
Vector2 as vec2,
Expand Down Expand Up @@ -99,6 +98,6 @@
"quicknet",
)

__version__ = importlib.metadata.version("apsg")
__version__ = "1.3.1"
__author__ = "Ondrej Lexa"
__email__ = "[email protected]"

0 comments on commit 18651b5

Please sign in to comment.