Skip to content

Commit bc49fb6

Browse files
authored
[Python 3.11.2 Upgrade] Updated Dockerfile, Requirements, and README (#41)
* Changes to Dockerfile, requirements and README to support upgrade to python 3.11.2. * Remove commented out manual entrypoint.
1 parent 78fbe2b commit bc49fb6

File tree

4 files changed

+40
-8
lines changed

4 files changed

+40
-8
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10.6-slim as base
1+
FROM python:3.11.2-slim as base
22

33
FROM base as builder
44

@@ -27,3 +27,4 @@ COPY . /opt/representer
2727
WORKDIR /opt/representer
2828

2929
ENTRYPOINT ["sh","/opt/representer/bin/run.sh"]
30+

README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,48 @@
11
# Exercism Python Representer
22

3-
An [automated anaylsis](analyis) tool that parses a Python file to create a normalized `representation.txt` file per the [representer interface][interface].
3+
An [automated analysis][analysis] tool that parses a Python file to create a normalized `representation.txt` file per the [representer interface][interface].
4+
5+
6+
# Creating A Representation
7+
8+
9+
The Representer is run with `./bin/run.sh` `<exercise-slug>` `<path/to/solution/dir/` `</path/to/output/dir/>` and will read the source code from `<path/to/solution/dir/>` and write a representation to`</path/to/output/dir/>`.
410

5-
It is run with `./bin/run.sh $EXERCISM $PATH_TO_FILES $PATH_FOR_OUTPUT` and will read the source code from `$PATH_TO_FILES` and write a representation to`$PATH_FOR_OUTPUT`.
611

712
For example:
813

914
```bash
1015
./bin/run.sh two_fer ~/solution-238382y7sds7fsadfasj23j/ ~/solution-238382y7sds7fsadfasj23j/output/
1116
```
1217

13-
18+
19+
**Please Note**: When using the `run-in-docker.sh` script, the paths `<path/to/solution/dir/>` and `</path/to/output/dir/>` need to be _**relative**_ to the location of this repo in your local environment.
20+
21+
22+
For example:
23+
24+
```bash
25+
./bin/run-in-docker.sh acronym ../python/exercises/practice/acronym/ ../python/exercises/practice/acronym/
26+
```
27+
28+
Either of these commands/methods should produce the following three files in `</path/to/output/dir/>`:
29+
30+
1. `mapping.json`, which maps the variable names to their placeholder values.
31+
2. `representation.out` - an AST representation of the solution code.
32+
3. `representation.txt` - the transformed solution code with placeholders.
33+
34+
35+
36+
# Running the Tests for the Representer
37+
38+
To run all of the current tests:
39+
40+
1. Ensure you have a copy of `pytest 7.2.2` installed globally, or in a virtual env.
41+
2. Ensure you have Python 3.11.2 installed globally, or in a virtual env.
42+
3. Open a terminal in the root of your local copy of this project.
43+
4. Run `pytest` or `pytest -v`
44+
45+
1446
[analysis]: https://github.com/exercism/automated-analysis
1547
[interface]: https://github.com/exercism/automated-analysis/blob/master/docs/representers/interface.md
1648

17-

dev-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pytest~=7.1.2
2-
1+
pytest~=7.2.2
2+
pytest-subtests~=0.10.0

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
astor==0.8.0
2-
black==22.3.0
2+
black<=22.3.0

0 commit comments

Comments
 (0)