Skip to content

Commit

Permalink
Merge pull request #2 from os-climate/repo-updates
Browse files Browse the repository at this point in the history
Chore: Repo updates
  • Loading branch information
ModeSevenIndustrialSolutions authored Jan 16, 2024
2 parents b886589 + fa6a0ce commit 34da724
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 44 deletions.
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- id: name-tests-test
args: ["--pytest-test-first"]
# Do not allow direct push to main/master branches
- id: no-commit-to-branch
# - id: pretty-format-json
Expand All @@ -63,7 +64,7 @@ repos:
hooks:
- id: prettier
args:
['--ignore-unknown', '--no-error-on-unmatched-pattern', '!chart/**']
['--ignore-unknown']

# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
Expand All @@ -79,12 +80,12 @@ repos:
# args: ['--py37-plus']

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.0
rev: 23.12.1
hooks:
- id: black

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.0
rev: 23.12.1
hooks:
- id: black-jupyter

Expand All @@ -97,7 +98,7 @@ repos:
rev: 2.1.1
hooks:
- id: bashate
args: ["--ignore=E006"]
args: ["--ignore=E006,E011"]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
Expand All @@ -118,9 +119,10 @@ repos:
# ]

- repo: https://github.com/PyCQA/isort
rev: 5.11.5
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
Expand Down Expand Up @@ -154,9 +156,9 @@ repos:
# - id: codespell

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.7.1"
rev: "v1.8.0"
hooks:
- id: mypy
verbose: true
args: [--show-error-codes]
additional_dependencies: ["types-requests"]
additional_dependencies: ["pytest", "types-requests"]
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/.pre-commit-config.yaml
**/*.yaml
**/*.yml
**/.git/**
26 changes: 13 additions & 13 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Contributing
============

Welcome to ``osc-data-extractor`` contributor's guide.
Welcome to ``osc-inception-converter`` contributor's guide.

This document focuses on getting any potential contributor familiarized
with the development processes, but `other kinds of contributions`_ are also
Expand All @@ -46,7 +46,7 @@ guidelines.
Issue Reports
=============

If you experience bugs or general issues with ``osc-data-extractor``, please have a look
If you experience bugs or general issues with ``osc-inception-converter``, please have a look
on the `issue tracker`_. If you don't see anything useful there, please feel
free to fire an issue report.

Expand All @@ -65,10 +65,10 @@ you help us to identify the root cause of the issue.
Documentation Improvements
==========================

You can help improve ``osc-data-extractor`` docs by making them more readable and coherent, or
You can help improve ``osc-inception-converter`` docs by making them more readable and coherent, or
by adding missing information and correcting mistakes.

``osc-data-extractor`` documentation uses Sphinx_ as its main documentation compiler.
``osc-inception-converter`` documentation uses Sphinx_ as its main documentation compiler.
This means that the docs are kept in the same repository as the project code, and
that any documentation update is done in the same way was a code contribution.

Expand All @@ -80,7 +80,7 @@ that any documentation update is done in the same way was a code contribution.

.. tip::
Please notice that the `GitHub web interface`_ provides a quick way of
propose changes in ``osc-data-extractor``'s files. While this mechanism can
propose changes in ``osc-inception-converter``'s files. While this mechanism can
be tricky for normal code contributions, it works perfectly fine for
contributing to the docs, and can be quite handy.

Expand Down Expand Up @@ -131,8 +131,8 @@ This can easily be done via either |virtualenv|_::

or Miniconda_::

conda create -n osc-data-extractor python=3 six virtualenv pytest pytest-cov
conda activate osc-data-extractor
conda create -n osc-inception-converter python=3 six virtualenv pytest pytest-cov
conda activate osc-inception-converter

Clone the repository
--------------------
Expand All @@ -142,8 +142,8 @@ Clone the repository
page. This creates a copy of the code under your account on |the repository service|.
#. Clone this copy to your local disk::

git clone [email protected]:YourLogin/osc-data-extractor.git
cd osc-data-extractor
git clone [email protected]:YourLogin/osc-inception-converter.git
cd osc-inception-converter

#. You should run::

Expand All @@ -158,7 +158,7 @@ Clone the repository
pip install pre-commit
pre-commit install

``osc-data-extractor`` comes with a lot of hooks configured to automatically help the
``osc-inception-converter`` comes with a lot of hooks configured to automatically help the
developer to check the code being written.

Implement your changes
Expand Down Expand Up @@ -285,7 +285,7 @@ Releases

If you are part of the group of maintainers and have correct user permissions
on PyPI_, the following steps can be used to release a new version for
``osc-data-extractor``:
``osc-inception-converter``:

#. Make sure all unit tests are successful.
#. Tag the current commit on the main branch with a release tag, e.g., ``v1.2.3``.
Expand Down Expand Up @@ -314,8 +314,8 @@ on PyPI_, the following steps can be used to release a new version for
.. |the repository service| replace:: GitHub
.. |contribute button| replace:: "Create pull request"

.. _repository: https://github.com/<USERNAME>/osc-data-extractor
.. _issue tracker: https://github.com/<USERNAME>/osc-data-extractor/issues
.. _repository: https://github.com/<USERNAME>/osc-inception-converter
.. _issue tracker: https://github.com/<USERNAME>/osc-inception-converter/issues
.. <-- end -->
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

.. image:: https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white
:alt: Source code on GitHub
:target: https://github.com/ModeSevenIndustrialSolutions/osc-data-extractor
:target: https://github.com/ModeSevenIndustrialSolutions/osc-inception-converter

.. image:: https://img.shields.io/pypi/v/osc-data-extractor.svg
.. image:: https://img.shields.io/pypi/v/osc-inception-converter.svg
:alt: PyPI package
:target: https://pypi.org/project/osc-data-extractor/
:target: https://pypi.org/project/osc-inception-converter/

.. image:: https://api.cirrus-ci.com/github/os-climate/osc-data-extractor.svg?branch=main
.. image:: https://api.cirrus-ci.com/github/os-climate/osc-inception-converter.svg?branch=main
:alt: Built Status
:target: https://cirrus-ci.com/github/os-climate/osc-data-extractor
:target: https://cirrus-ci.com/github/os-climate/osc-inception-converter

.. image:: https://img.shields.io/badge/PDM-Project-purple
:alt: Built using PDM
Expand All @@ -30,7 +30,7 @@


==================
osc-data-extractor
osc-inception-converter
==================

OS-Climate Data Extraction Tool
Expand Down
10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from sphinx import apidoc

output_dir = os.path.join(__location__, "api")
module_dir = os.path.join(__location__, "../src/osc_data_extractor")
module_dir = os.path.join(__location__, "../src/osc_inception_converter")
try:
shutil.rmtree(output_dir)
except FileNotFoundError:
Expand Down Expand Up @@ -87,7 +87,7 @@
master_doc = "index"

# General information about the project.
project = "osc-data-extractor"
project = "osc-inception-converter"
copyright = "2023, Matthew Watkins"

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -99,7 +99,7 @@
# If you don’t need the separation provided between version and release,
# just set them both to the same value.
try:
from osc_data_extractor import __version__ as version
from osc_inception_converter import __version__ as version
except ImportError:
version = ""

Expand Down Expand Up @@ -229,7 +229,7 @@
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = "osc-data-extractor-doc"
htmlhelp_basename = "osc-inception-converter-doc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -246,7 +246,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
("index", "user_guide.tex", "osc-data-extractor Documentation", "Matthew Watkins", "manual")
("index", "user_guide.tex", "osc-inception-converter Documentation", "Matthew Watkins", "manual")
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
==================
osc-data-extractor
osc-inception-converter
==================

This is the documentation of **osc-data-extractor**.
This is the documentation of **osc-inception-converter**.

.. note::

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "osc-data-extractor"
name = "osc-inception-converter"
version = "0.1.0"
description = "OS-Climate Data Extraction Tool"
authors = [
Expand Down Expand Up @@ -42,7 +42,7 @@ build-backend = "pdm.backend"
license-files = ["LICENSES.txt"]

[project.scripts]
osc-data-extractor = "osc_data_extractor.skeleton:run"
osc-inception-converter = "osc_inception_converter.skeleton:run"

[project.optional-dependencies]
dev = [
Expand Down
24 changes: 24 additions & 0 deletions scripts/rename-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

#set -x

REPO_NAME=$(basename "$(git rev-parse --show-toplevel)")
echo "Repository name: $REPO_NAME"

if [ $# -ne 1 ]; then
echo "Usage: $0 [test folder]"; exit 1
elif [ ! -d "$1" ]; then
echo "Error: specified target was not a folder"; exit 1
else
# Target specified was a folder
TARGET="$1"
fi

for TEST in $(find "$TARGET" -type f -name '*_test.py' | xargs -0); do
echo "Processing: $TEST"
FILE_PATH=$(dirname "$TEST")
FILE_NAME=$(basename "$TEST")
STRIPPED="${FILE_NAME//_test.py/.py}"
echo " git mv \"${TEST}\" $FILE_PATH/test_\"${STRIPPED%%}\""
git mv "${TEST}" "$FILE_PATH"/test_"${STRIPPED%%}"
done
Loading

0 comments on commit 34da724

Please sign in to comment.