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

Prepare for initial release on PyPI #16

Merged
merged 11 commits into from
Mar 4, 2025
Merged
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
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Provide a general summary of your changes in the Title above -->

## Description
<!-- Describe your changes in detail -->

## Motivation and Context
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->

## Checklist:
<!-- Please select all items that apply either now or after creating the pull request. -->
<!-- If you are unsure about any of these items, do not hesitate to ask! -->
- [ ] The changes introduced by this pull request are covered by existing or newly introduced tests.
- [ ] I have updated the [changelog](https://github.com/janbridley/svg3d/blob/main/changelog.md).
77 changes: 77 additions & 0 deletions .github/workflows/pypi-test-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build and Publish

on:
push:
tags:
- "v*"
branches:
- "main"
- "breaking"
pull_request:

jobs:
build:
name: Build Distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.2.2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5.4.0
with:
python-version: "3.x"

- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4.4.3
with:
name: python-package-distributions
path: dist/

publish-to-testpypi:
name: Publish to TestPyPI
needs: [build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/svg3d
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v4.1.8
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
skip-existing: true

publish-to-pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
needs: [build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/svg3d
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v4.1.8
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.2
128 changes: 0 additions & 128 deletions 1AI0.mtl

This file was deleted.

28 changes: 17 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

.. container:: row

.. image:: doc/source/_static/cube-wireframe.svg
.. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/cube-wireframe.svg
:alt: Cube Wireframe
:width: 17%

.. image:: doc/source/_static/cycle-compact.svg
.. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/cycle-compact.svg
:alt: Alternation Cycle
:width: 17%

.. image:: doc/source/_static/CrumpledDevelopable-tri-compact.svg
.. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/CrumpledDevelopable-tri-compact.svg
:alt: Keenan CrumpledDevelopable
:width: 17%

.. image:: doc/source/_static/oloid_64-tri-compact.svg
.. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/oloid_64-tri-compact.svg
:alt: Keenan Oloid
:width: 17%

.. image:: doc/source/_static/bunny-tri-compact.svg
.. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/bunny-tri-compact.svg
:alt: Stanford Bunny
:width: 17%

Expand All @@ -43,8 +43,14 @@ Many thanks to the `Keenan 3D Model repository <https://www.cs.cmu.edu/~kmcrane/
Installation
============

`svg3d` is not yet available via PyPI or Conda Forge. While this is the case, please
build from source to install the package.
`svg3d` is available on PyPI, and can be easily installed from there:

.. code-block:: bash

pip install svg3d


The package can also be built from source:

.. code-block:: bash

Expand Down Expand Up @@ -97,9 +103,9 @@ Quickstart Example
* - Isometric
- Dimetric
- Trimetric
* - .. image:: doc/source/_static/iso.svg
- .. image:: doc/source/_static/dim.svg
- .. image:: doc/source/_static/tri.svg
* - .. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/iso.svg
- .. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/dim.svg
- .. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/tri.svg

.. _usageexample:

Expand Down Expand Up @@ -173,4 +179,4 @@ In addition to convenience methods, `svg3d` allows full control over the viewpor

Running the code above generates the following image:

.. image:: doc/source/_static/cube-wireframe.svg
.. image:: https://raw.githubusercontent.com/janbridley/svg3d/refs/heads/main/doc/source/_static/cube-wireframe.svg
35 changes: 35 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog

The format is based on `Keep a Changelog <http://keepachangelog.com/en/1.0.0/>`__.
This project adheres to `Semantic Versioning <http://semver.org/spec/v2.0.0.html>`__.

## v0.1.2

### Fixed

- Image links in README.rst

## v0.1.1

### Added

- Added public ReadtheDocs page.
- Additional examples

## v0.1.0

### Changed:
- Removed `pyrr` dependency by implementing matrix methods
- `Mesh` class is now more verstaile, and supports initialization from `Coxeter` objects

### Added:
- Added `isometric`, `dimetric`, and `trimetric` convenience functions to `View` class.
- Support meshes with nonuniform degree (e.g. mixed tri-quad meshes). Faces are padded out to the largest polygon's size in the projection step, and are filtered back down before drawing the SVG.
- `get_lookat_matrix` and `get_projection_matrix` methods to replace calls to `pyrr` required by the old version
- Additional tests and CI
- New `Shader` submodule, which supports a few basic lighting models and provides an interface for future development

### Removed:
- `Camera` class has been replaced with `view.look_at` and `view.projection`
- `Scene` class has been removed in favor of basic Python iterables.
- `extras` from original svg3d
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"

[project]
name = "svg3d"
version = "0.1.0"
requires-python = ">=3.6"
version = "0.1.2"
requires-python = ">=3.10"
description = "Minimal library for rendering polyhedra as SVG wireframes."
readme = "README.md"
readme = "README.rst"
license = { file = "LICENSE" }
authors = [
{name = "Jen Bradley", email = "jenbrad@umich.edu"},
Expand Down
46 changes: 0 additions & 46 deletions svg3d/io.py

This file was deleted.

3 changes: 2 additions & 1 deletion svg3d/svg3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"""

import warnings
from typing import TYPE_CHECKING, Callable
from collections.abc import Callable
from typing import TYPE_CHECKING

import numpy as np
import svgwrite
Expand Down
Loading