Skip to content

Commit

Permalink
Update pip package config
Browse files Browse the repository at this point in the history
  • Loading branch information
leavauchier committed Apr 18, 2024
1 parent d52810e commit 4667f94
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ exclude =
.git
__pycache__
logs/*
.vscode/*
.vscode/*
23 changes: 11 additions & 12 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,17 @@ jobs:
docker run myria3d:${{github.ref_name}} bash # Run the new, tagged image at least once so that is it not prunned by mistake when using docker system prune
# docker save myria3d:${{github.ref_name}} -o /var/data/cicd/CICD_github_assets/CICD_docker_images/myria3d_${github.ref_name}.tar # Save the docker image as myria3d_${github.ref_name}.tar
# get version number and date, to tag the image pushed to a private docker registry
- name: get version number
id: tag
run: |
echo "VERSION=$(docker run myria3d grep '__version__' package_metadata.yaml| cut -d\" -f2)" >> $GITHUB_ENV
echo "DATE=$(date '+%Y.%m.%d')" >> $GITHUB_ENV
# show possible tags, for debugging purpose
- name: Print tags
run: |
echo "${{ env.VERSION }}"
echo "${{ env.DATE }}"
# get version number and date, to tag the image pushed to a private docker registry
- name: get version number
id: tag
run: |
echo "VERSION=$(docker run lidar_prod python -m myria3d._version)" >> $GITHUB_ENV
echo "DATE=$(date '+%Y.%m.%d')" >> $GITHUB_ENV
# show possible tags, for debugging purpose
- name: Print tags
run: |
echo "${{ env.VERSION }}"
echo "${{ env.DATE }}"
- name: push main docker on nexus (tagged with a date)
# we push on nexus an image from the main branch when it has been updated (push or accepted pull request)
Expand Down
15 changes: 8 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@
import os
import sys

import yaml
import tomli
from hydra import compose, initialize
from omegaconf import OmegaConf

rel_root_path = "./../../"
abs_root_path = os.path.abspath(rel_root_path)
sys.path.insert(0, abs_root_path)

from myria3d._version import __version__ # noqa: E402

# -- Project information -----------------------------------------------------
with open(os.path.join(abs_root_path, "package_metadata.yaml"), "r") as f:
pm = yaml.safe_load(f)
with open(os.path.join(abs_root_path, "pyproject.toml"), "rb") as f:
data = tomli.load(f)

release = pm["__version__"]
project = pm["__name__"]
author = pm["__author__"]
copyright = pm["__copyright__"]
release = __version__
project = data["project"]["name"]
author = ", ".join([a["name"] for a in data["project"]["authors"]])
copyright = data["metadata"]["copyright"]

# -- YAML main to print the config into ---------------------------------------------------
# We need to concatenate configs into a single file using hydra
Expand Down
2 changes: 1 addition & 1 deletion docs/source/guides/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Code versionning

Package version follows semantic versionning conventions and is defined in `package_metadata.yaml`.
Package version follows semantic versionning conventions and is defined in `myria3d._version.py`.

Releases are created when new high-level functionnality are implemented (e.g. a new step in the production process), with a documentation role. A `prod-release-tag` is created that tracks an _arbitrary_ commit, and serves as a mean to make a few models, model card, and config accessible via its associated [release](https://github.com/IGNF/myria3d/releases/tag/prod-release-tag).

Expand Down
5 changes: 5 additions & 0 deletions myria3d/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__version__ = "3.8.3"


if __name__ == "__main__":
print(__version__)
6 changes: 0 additions & 6 deletions package_metadata.yaml

This file was deleted.

35 changes: 34 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
[project]
name = "myria3d"
dynamic = ["version"]
description = "Deep Learning for the Semantic Segmentation of Aerial Lidar Point Clouds"
readme = "README.md"
authors = [
{ name = "Charles GAYDON", email = "[email protected]" }
]
maintainers = [
{name = "Charles GAYDON", email = "[email protected]"},
{name = "Michel DAAB"},
{name = "Léa VAUCHIER", email = "[email protected]"}
]
license = {file = "LICENSE"}
dependencies = [] # assume an environment as described in environment.yml

[metadata]
project_template = "https://github.com/ashleve/lightning-hydra-template"
copyright = "2022, Institut National de l'Information Géographique et Forestière"

[project.urls]
Documentation = "https://ignf.github.io/myria3d/"
Repository = "https://github.com/IGNF/myria3d"
Issues = "https://github.com/IGNF/myria3d/issues"
Changelog = "https://github.com/IGNF/myria3d/blob/main/CHANGELOG.md"

[tool.setuptools.dynamic]
version = {attr = "myria3d._version.__version__"}

[tool.setuptools]
packages = [ "myria3d" ]

[tool.black]
line-length = 99
target-version = ['py39']
Expand Down Expand Up @@ -28,8 +60,9 @@ filterwarnings = [
"ignore::DeprecationWarning",
"ignore::UserWarning"
]

markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"slow: marks tests as slow (deselect with '-m \"not slow\"')"
]

[tool.coverage.run]
Expand Down
17 changes: 0 additions & 17 deletions setup.py

This file was deleted.

0 comments on commit 4667f94

Please sign in to comment.