Skip to content

Errors when running .initialize_new_project.sh #538

@drewoldag

Description

@drewoldag

Got errors when running .initialize_new_project.sh

(ext_hyrax) drew@triceratops:~/code/ext-hyrax-example$ bash .initialize_new_project.sh
<standard install stuff>
Installing pre-commit
Committing initial files
[INFO] Initializing environment for https://github.com/abravalheri/validate-pyproject.
[INFO] Initializing environment for https://github.com/abravalheri/validate-pyproject:.[all].
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Installing environment for https://github.com/abravalheri/validate-pyproject.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Check template version...................................................Passed
- hook id: check-lincc-frameworks-template-version
- duration: 0.53s
Clear output from Jupyter notebooks......................................Passed
Prevent main branch commits.............................................Skipped
Check for large files....................................................Passed
Validate pyproject.toml..................................................Passed
Validate GitHub Workflows................................................Passed
Lint code using ruff; sort and organize imports..........................Failed
- hook id: ruff
- files were modified by this hook

Found 2 errors (2 fixed, 0 remaining).

Format code using ruff...................................................Passed
Build documentation with Sphinx..........................................Passed
Run unit tests...........................................................Failed
- hook id: pytest-check
- exit code: 1

tests/external_hyrax_example/test_packaging.py: 1

============================= test session starts ==============================
platform linux -- Python 3.13.7, pytest-8.4.2, pluggy-1.6.0
rootdir: /home/drew/code/ext-hyrax-example
configfile: pyproject.toml
testpaths: tests, src, docs
plugins: cov-7.0.0, anyio-4.11.0
collected 1 item

tests/external_hyrax_example/test_packaging.py F                         [100%]

=================================== FAILURES ===================================
_________________________________ test_version _________________________________

    def test_version():
        """Check to see that we can get the package version"""
>       assert external_hyrax_example.__version__ is not None
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       AttributeError: module 'external_hyrax_example' has no attribute '__version__'. Did you mean: '_version'?

tests/external_hyrax_example/test_packaging.py:6: AttributeError
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.13.7-final-0 ________________

Coverage HTML written to dir htmlcov
=========================== short test summary info ============================
FAILED tests/external_hyrax_example/test_packaging.py::test_version - AttributeError: module 'external_hyrax_example' has no attribute '__version...
============================== 1 failed in 0.05s ===============================

.initialize_new_project.sh: Error on line 62: SKIP="no-commit-to-branch" git commit -m "Initial commit"
(ext_hyrax) drew@triceratops:~/code/ext-hyrax-example$ git diff
diff --git a/src/external_hyrax_example/__init__.py b/src/external_hyrax_example/__init__.py
index 8dee4bf..e69de29 100644
--- a/src/external_hyrax_example/__init__.py
+++ b/src/external_hyrax_example/__init__.py
@@ -1 +0,0 @@
-from ._version import __version__
diff --git a/tests/external_hyrax_example/test_packaging.py b/tests/external_hyrax_example/test_packaging.py
index c4ccbc6..5d12525 100644
--- a/tests/external_hyrax_example/test_packaging.py
+++ b/tests/external_hyrax_example/test_packaging.py
@@ -3,4 +3,4 @@ import external_hyrax_example

 def test_version():
     """Check to see that we can get the package version"""
-    assert external_hyrax_example.__version__ is not None
\ No newline at end of file
+    assert external_hyrax_example.__version__ is not None
(ext_hyrax) drew@triceratops:~/code/ext-hyrax-example$

Using these copier answers

Changes here will be overwritten by Copier
_commit: v2.0.8
_src_path: gh:lincc-frameworks/python-project-template
author_email: awoldag@uw.edu
author_name: Drew Oldag
create_example_module: false
custom_install: true
enforce_style:
- ruff_lint
- ruff_format
failure_notification: []
include_benchmarks: false
include_docs: true
include_notebooks: true
mypy_type_checking: none
package_name: external_hyrax_example
project_license: MIT
project_name: external_hyrax_example
project_organization: lincc-frameworks
python_versions:
- '3.11'
- '3.12'
- '3.13'
test_lowest_version: none

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions