Skip to content

Commit

Permalink
trying the instill version into conda
Browse files Browse the repository at this point in the history
  • Loading branch information
procrastinatio committed Feb 2, 2025
1 parent 3f49879 commit ace56a8
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ __pycache__
.idea
output/Thumbs.db
*.egg-info
*.egg

# build
dist/
build/

src/geocover_qa/_version.py

3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include src/geocover_qa/data/*.gpkg
include src/geocover_qa/data/*.json
include src/geocover_qa/data/*.json
inlcude src/geocover_qa/_version.py
19 changes: 19 additions & 0 deletions get_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python

from setuptools_scm import get_version
import os

def get_project_version(setup_py_path):
# Change the current working directory to the directory of setup.py
setup_dir = os.path.dirname(setup_py_path)
os.chdir(setup_dir)

# Get the version using setuptools_scm
version = get_version()

return version

if __name__ == '__main__':
setup_py_path = './setup.py' # Adjust the path to your setup.py file
version = get_project_version(setup_py_path)
print(version)
10 changes: 6 additions & 4 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# meta.yaml (base package without GUI)
{% set data = load_setup_py_data() %}
{% set data = load_setup_py_data(setup_file='./setup.py', from_recipe_dir=True) %}




package:
name: geocover-qa
#version: {{ data.get('version') }}
version: {{ environ.get("CI_COMMIT_TAG", "0.1") }} # Use CI environment variable for versioning
version: {{ environ.get('MYPKG_VERSION', '') }}
#version: {{ environ.get("CI_COMMIT_TAG", "0.1") }} # Use CI environment variable for versioning

source:
path: .


build:
noarch: python
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
string: py{{ environ.get('CONDA_PY', '') }}_{{ environ.get('GIT_BUILD_STR', 'local') }}
script: {{ PYTHON }} -m pip install . --no-deps -vv
# Exclude GUI-related files
ignore_prefix_files:
- gui/*
build:
- setuptools_scm>=8
- setuptools>=64

requirements:
host:
Expand Down
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2","setuptools_scm[toml]>=6.2", "setuptools_scm_git_semver",]
build-backend = "setuptools.build_meta"




[tool.setuptools_scm]
write_to = "src/geocover_qa/_version.py"
version_scheme = "post-release"
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"

normalize = false
write_to = "src/geocover_qa/_version.py"


[project]
Expand Down
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
from setuptools import setup, find_packages

setup(
setup_requires=["setuptools_scm"],
use_scm_version={
# 'root': '.', # GIT root
"write_to": "src/geocover_qa/_version.py",
"version_scheme": "release-branch-semver", # 'post-release',
"local_scheme": "no-local-version", #'dirty-tag',
"fallback_version": "0.1",
},
setup_requires=["setuptools_scm", "setuptools-git-versioning>=2.0,<3"],
use_scm_version=True,

name="geocover-qa",
packages=find_packages(where="src"),
package_dir={"": "src"},
Expand Down

0 comments on commit ace56a8

Please sign in to comment.