Skip to content

Commit 8758987

Browse files
authored
Merge pull request #2786 from jedwards4b/update_git_fleximod
Update git fleximod
2 parents 5db92d5 + 82d93ab commit 8758987

File tree

13 files changed

+806
-430
lines changed

13 files changed

+806
-430
lines changed

.lib/git-fleximod/.github/workflows/pytest.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# reference the matrixe python version here.
1919
- uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.9'
21+
python-version: '3.12'
2222

2323
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
2424
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/cache@v4
3030
with:
3131
path: ~/.local
32-
key: poetry-1.7.1
32+
key: poetry-1.8.2
3333

3434
# Install Poetry. You could do this manually, or there are several actions that do this.
3535
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
@@ -42,7 +42,7 @@ jobs:
4242
# cache it.
4343
- uses: snok/install-poetry@v1
4444
with:
45-
version: 1.7.1
45+
version: 1.8.2
4646
virtualenvs-create: true
4747
virtualenvs-in-project: true
4848

@@ -74,4 +74,7 @@ jobs:
7474
git config --global user.name "${GITHUB_ACTOR}"
7575
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
7676
poetry run pytest
77+
- name: Setup tmate session
78+
if: ${{ failure() }}
79+
uses: mxschmitt/action-tmate@v3
7780

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Contributor Code of Conduct
2+
_The Contributor Code of Conduct is for participants in our software projects and community._
3+
4+
## Our Pledge
5+
We, as contributors, creators, stewards, and maintainers (participants), of **git-fleximod** pledge to make participation in
6+
our software, system or hardware project and community a safe, productive, welcoming and inclusive experience for everyone.
7+
All participants are required to abide by this Code of Conduct.
8+
This includes respectful treatment of everyone regardless of age, body size, disability, ethnicity, gender identity or expression,
9+
level of experience, nationality, political affiliation, veteran status, pregnancy, genetic information, physical appearance, race,
10+
religion, or sexual orientation, as well as any other characteristic protected under applicable US federal or state law.
11+
12+
## Our Standards
13+
Examples of behaviors that contribute to a positive environment include:
14+
15+
* All participants are treated with respect and consideration, valuing a diversity of views and opinions
16+
* Be considerate, respectful, and collaborative
17+
* Communicate openly with respect for others, critiquing ideas rather than individuals and gracefully accepting criticism
18+
* Acknowledging the contributions of others
19+
* Avoid personal attacks directed toward other participants
20+
* Be mindful of your surroundings and of your fellow participants
21+
* Alert UCAR staff and suppliers/vendors if you notice a dangerous situation or someone in distress
22+
* Respect the rules and policies of the project and venue
23+
24+
Examples of unacceptable behavior include, but are not limited to:
25+
26+
* Harassment, intimidation, or discrimination in any form
27+
* Physical, verbal, or written abuse by anyone to anyone, including repeated use of pronouns other than those requested
28+
* Unwelcome sexual attention or advances
29+
* Personal attacks directed at other guests, members, participants, etc.
30+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
31+
* Alarming, intimidating, threatening, or hostile comments or conduct
32+
* Inappropriate use of nudity and/or sexual images
33+
* Threatening or stalking anyone, including a participant
34+
* Other conduct which could reasonably be considered inappropriate in a professional setting
35+
36+
## Scope
37+
This Code of Conduct applies to all spaces managed by the Project whether they be physical, online or face-to-face.
38+
This includes project code, code repository, associated web pages, documentation, mailing lists, project websites and wiki pages,
39+
issue tracker, meetings, telecons, events, project social media accounts, and any other forums created by the project team which the
40+
community uses for communication.
41+
In addition, violations of this Code of Conduct outside these spaces may affect a person's ability to participate within them.
42+
Representation of a project may be further defined and clarified by project maintainers.
43+
44+
## Community Responsibilities
45+
Everyone in the community is empowered to respond to people who are showing unacceptable behavior.
46+
They can talk to them privately or publicly.
47+
Anyone requested to stop unacceptable behavior is expected to comply immediately.
48+
If the behavior continues concerns may be brought to the project administrators or to any other party listed in the
49+
[Reporting](#reporting) section below.
50+
51+
## Project Administrator Responsibilities
52+
Project administrators are responsible for clarifying the standards of acceptable behavior and are encouraged to model appropriate
53+
behavior and provide support when people in the community point out inappropriate behavior.
54+
Project administrator(s) are normally the ones that would be tasked to carry out the actions in the [Consequences](#consequences)
55+
section below.
56+
57+
Project administrators are also expected to keep this Code of Conduct updated with the main one housed at UCAR, as listed below in
58+
the [Attribution](#attribution) section.
59+
60+
## Reporting
61+
Instances of unacceptable behavior can be brought to the attention of the project administrator(s) who may take any action as
62+
outlined in the [Consequences](#consequences) section below.
63+
However, making a report to a project administrator is not considered an 'official report' to UCAR.
64+
65+
Instances of unacceptable behavior may also be reported directly to UCAR pursuant to [UCAR's Harassment Reporting and Complaint
66+
Procedure](https://www2.fin.ucar.edu/procedures/hr/harassment-reporting-and-complaint-procedure), or anonymously through [UCAR's
67+
EthicsPoint Hotline](https://www2.fin.ucar.edu/ethics/anonymous-reporting).
68+
69+
Complaints received by UCAR will be handled pursuant to the procedures outlined in UCAR's Harassment Reporting and Complaint
70+
Procedure.
71+
Complaints to UCAR will be held as confidential as practicable under the circumstances, and retaliation against a person who
72+
initiates a complaint or an inquiry about inappropriate behavior will not be tolerated.
73+
74+
Any Contributor can use these reporting methods even if they are not directly affiliated with UCAR.
75+
The Frequently Asked Questions (FAQ) page for reporting is [here](https://www2.fin.ucar.edu/procedures/hr/reporting-faqs).
76+
77+
## Consequences
78+
Upon receipt of a complaint, the project administrator(s) may take any action deemed necessary and appropriate under the
79+
circumstances.
80+
Such action can include things such as: removing, editing, or rejecting comments, commits, code, wiki edits, email, issues, and
81+
other contributions that are not aligned to this Code of Conduct, or banning temporarily or permanently any contributor for other
82+
behaviors that are deemed inappropriate, threatening, offensive, or harmful.
83+
Project administrators also have the right to report violations to UCAR HR and/or UCAR's Office of Diversity, Equity and Inclusion
84+
(ODEI), as well as a participant's home institution and/or law enforcement.
85+
In the event an incident is reported to UCAR, UCAR will follow its Harassment Reporting and Complaint Procedure.
86+
87+
## Process for Changes
88+
All UCAR managed projects are required to adopt this Contributor Code of Conduct.
89+
Adoption is assumed even if not expressly stated in the repository.
90+
Projects should fill in sections where prompted with project-specific information, including, project name and adoption date.
91+
92+
Projects that adopt this Code of Conduct need to stay up to date with UCAR's Contributor Code of Conduct, linked with a DOI in the
93+
[Attribution](#attribution) section below.
94+
Projects can make limited substantive changes to the Code of Conduct, however, the changes must be limited in scope and may not
95+
contradict the UCAR Contributor Code of Conduct.
96+
97+
## Attribution
98+
This Code of Conduct was originally adapted from the [Contributor Covenant](http://contributor-covenant.org/version/1/4), version
99+
1.4.
100+
We then aligned it with the UCAR Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of
101+
Conduct.
102+
The UCAR Participant Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR.
103+
The original version of this for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR
104+
website at https://doi.org/10.5065/6w2c-a132.
105+
The date that it was adopted by this project was **Feb/13/2018**.
106+
When responding to complaints, UCAR HR and ODEI will do so based on the latest published version.
107+
Therefore, any project-specific changes should follow the [Process for Changes](#process-for-changes) section above.

.lib/git-fleximod/git_fleximod/cli.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,31 @@
22
import argparse
33
from git_fleximod import utils
44

5-
__version__ = "0.7.8"
5+
__version__ = "0.9.3"
66

77
def find_root_dir(filename=".gitmodules"):
88
""" finds the highest directory in tree
99
which contains a file called filename """
10-
d = Path.cwd()
11-
root = Path(d.root)
12-
dirlist = []
13-
dl = d
14-
while dl != root:
15-
dirlist.append(dl)
16-
dl = dl.parent
17-
dirlist.append(root)
18-
dirlist.reverse()
19-
20-
for dl in dirlist:
21-
attempt = dl / filename
22-
if attempt.is_file():
23-
return str(dl)
24-
return None
25-
10+
try:
11+
root = utils.execute_subprocess(["git","rev-parse", "--show-toplevel"],
12+
output_to_caller=True ).rstrip()
13+
except:
14+
d = Path.cwd()
15+
root = Path(d.root)
16+
dirlist = []
17+
dl = d
18+
while dl != root:
19+
dirlist.append(dl)
20+
dl = dl.parent
21+
dirlist.append(root)
22+
dirlist.reverse()
23+
24+
for dl in dirlist:
25+
attempt = dl / filename
26+
if attempt.is_file():
27+
return str(dl)
28+
return None
29+
return Path(root)
2630

2731
def get_parser():
2832
description = """

0 commit comments

Comments
 (0)