Skip to content

Commit

Permalink
Prevent module import when running setup.py clean (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
pac48 committed Jul 31, 2023
1 parent e3876c1 commit 1aac3a8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions example_python/setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# -*- coding: utf-8 -*-
import sys
from setuptools import setup
from generate_parameter_library_py.setup_helper import generate_parameter_module

package_name = "generate_parameter_module_example"

# set module_name and yaml file
module_name = "admittance_parameters"
yaml_file = "generate_parameter_module_example/parameters.yaml"
validation_module = "generate_parameter_module_example.custom_validation"
generate_parameter_module(module_name, yaml_file, validation_module=validation_module)
if len(sys.argv) >= 2 and sys.argv[1] != "clean":
from generate_parameter_library_py.setup_helper import generate_parameter_module

# set module_name and yaml file
module_name = "admittance_parameters"
yaml_file = "generate_parameter_module_example/parameters.yaml"
validation_module = "generate_parameter_module_example.custom_validation"
generate_parameter_module(
module_name, yaml_file, validation_module=validation_module
)

setup(
name=package_name,
Expand Down

0 comments on commit 1aac3a8

Please sign in to comment.