Skip to content

Commit

Permalink
Merge pull request #33 from Dessia-tech/dev
Browse files Browse the repository at this point in the history
Towards V2.0.0-rc.2
  • Loading branch information
sbendjebla authored Nov 26, 2024
2 parents 9aec5a9 + 48fd32a commit 7c0bb14
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 21 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v2.0.0-rc.2] - 26/11/2024

### Added

- Set up the remote repository to the new local Git repository
- Add CI trigger on tag push for dist build
- Update files extensions to skip in codespell

### Fixed

- Remove numpy dependency in unit tests


## [v2.0.0-rc.1] - 11/10/2024

Expand Down Expand Up @@ -43,7 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Update README.md
- Update README.md

## [v0.1.0] - 07/01/2021

Expand All @@ -53,5 +65,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0


## [v0.0.1] - 22/10/2020 (Initialization)


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ After filling in the .ini inputs file, run the create_package.py script to gener

- Log in to your GitHub account
- Click the "+" icon in the top-right corner and select "New repository"
- Choose a project name for your repository (the directory containing your package): The project name is the CamelCase version of the package name choosen in the .ini inputs file
- Choose a project name for your repository (the directory containing your package): The project name is the CamelCase version of the package name chosen in the .ini inputs file
- Do not initialize the repository with a README, .gitignore, or license
- Click "Create repository"

Expand Down
21 changes: 10 additions & 11 deletions create_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,20 @@ def replace_placeholders(_file_path: str, _placeholders: dict) -> None:

# Initialize a new Git repository
os.chdir(new_package_dir) # Change directory to the new package directory
subprocess.run(["git", "init"], check=False) # Initialize a new git repository
subprocess.run(["git", "add", "."], check=False) # Add all files to staging
subprocess.run(["git", "commit", "-m", "Initial commit"], check=False) # Commit the changes
subprocess.run(["git", "init"], check=True) # Initialize a new git repository
subprocess.run(["git", "add", "."], check=True) # Add all files to staging
subprocess.run(["git", "commit", "-m", "Initial commit"], check=True) # Commit the changes

# Rename the default branch to 'master'
subprocess.run(["git", "branch", "-M", "master"], check=False)
subprocess.run(["git", "branch", "-M", "master"], check=True)

if parameters["package_url"]:
# Set up the upstream repository and push
push_command = (
f"git push --set-upstream git@{parameters['package_url']}/"
f"$(git rev-parse --show-toplevel | xargs basename).git "
f"$(git rev-parse --abbrev-ref HEAD)"
)
subprocess.run(push_command, shell=True, check=False)
# Set up the remote repository
remote_url = f"git@{parameters['package_url']}/{parameters['project_package_name']}.git"
subprocess.run(["git", "remote", "add", "origin", remote_url], check=True)

# Push to the remote repository
subprocess.run(["git", "push", "-u", "origin", "master"], check=True)

print(f"\nA new Git repository has been initialized in {new_package_dir}.")

Expand Down
2 changes: 1 addition & 1 deletion methods/methods_get_parameters_from_ini_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def read_config_to_dict(file_path: str) -> dict:
""""Read a configuration file and returns its contents as a dictionary, excluding the 'DOCUMENTATION' section."""
"""Read a configuration file and returns its contents as a dictionary, excluding the 'DOCUMENTATION' section."""
config = configparser.ConfigParser()
config.read(file_path)

Expand Down
4 changes: 3 additions & 1 deletion package_folder/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ stages:
- verify
- check
- test
- build


# Verify that the changelog has been updated
Expand Down Expand Up @@ -60,7 +61,7 @@ install_run_scripts_and_unittests:

# Generate dist wheel and source distribution on master branch
generate_dist_wheel:
stage: test
stage: build
tags:
- dessia_ubuntu
image: python:3.9
Expand All @@ -70,6 +71,7 @@ generate_dist_wheel:
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "testing"'
- if: '$CI_COMMIT_TAG'
artifacts:
paths:
- dist/*.whl
Expand Down
2 changes: 1 addition & 1 deletion package_folder/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ convention = "pep257"
"tests/**/*.py" = ["D"] # documenting the unit tests is not necessary

[tool.codespell]
skip = ["*.json", "*.html", "*.js", "*.css", ".c", ".h", ".cpp", ".hpp", "*.xml"]
skip = ["*.json", "*.html", "*.js", "*.css", "*.c", "*.h", "*.cpp", "*.hpp", "*.xml", "*.stp", "*.step", "*.CATPart"]
ignore-words-list = ["dessia"] # words to ignore from codespell check

[tool.coverage.run]
Expand Down
4 changes: 1 addition & 3 deletions package_folder/tests/test_exemple.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import unittest

import numpy as np


class TestClassName(unittest.TestCase):
def test_method_name(self) -> None:
results = [0, 3, 0]
self.assertTrue(np.all(results == np.array([0, 3, 0])))
self.assertEqual([0, 3, 0], results)


if __name__ == "__main__":
Expand Down

0 comments on commit 7c0bb14

Please sign in to comment.